adambard / learnxinyminutes-docs

Code documentation written as code! How novel and totally my idea!
https://learnxinyminutes.com/
Other
11.51k stars 3.35k forks source link

[objective-c/en] Couple of inconsistencies #4290

Open mkmkme opened 2 years ago

mkmkme commented 2 years ago

I've found a couple of issues in the given code that I can't fix myself due to lack of skill in Objective-C and/or not getting the authors' intention in some particular parts of the code. If anyone gives any hints, I'll be happy to fix this myself.

@implementation MyClass { long distance; NSNumber *height; }

However, since these are not properties, XCode is getting confused when trying to access them:
<img width="1212" alt="image" src="https://user-images.githubusercontent.com/4062234/146678657-7bebec9e-3d29-4437-85b6-f8af6fc0bc0a.png">

- [ ] The same issue applies to `height` in `@implementation` block:
```objective-c
@implementation MyClass {
    long distance;
    NSNumber *height;
}

XCode is confused and refuses to compile myClassFromHeight:

image
mkmkme commented 2 years ago

Extension example also confuses XCode quite a bit:

image

Also, the return type of the overloaded function is also missing the asterisk.