kodecocodes / objective-c-style-guide

A style guide that outlines the coding conventions for Kodeco
http://www.raywenderlich.com/62570/objective-c-style-guide
3.1k stars 628 forks source link

Should self keyword should be used in init methods ? #74

Closed williamhqs closed 7 years ago

williamhqs commented 7 years ago

I saw seems all places the properties was inited by the keyword self which wasn't recommended by Apple.

For example:

- (id)init {
    self = [super init];
    if (self) {
        self.walletService = [[Xxx alloc] initWithPresenter:nil];
    }
    return self;
}

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html http://qualitycoding.org/objective-c-init/ https://stackoverflow.com/a/8056260/291240