Reputation: 1104
I found three kind of coding style when writing method declaration and implementation
-(id)delegate;
- (id)delegate;
- (id) delegate;
The first is really rare.
Sice I am a IOS developer , I found the second one is the most in UIKit and most code i found online is in this style.
My colleague told me that the third one is very common in Mac OS X
Personally, I prefer the second type. I'm just wondering is there any coding convention about this question?
Upvotes: 0
Views: 392
Reputation: 11703
You can use whatever style you like for your own code. If you join an open source project, you will use the style set forth in that project. The main goal is to be consistent in your style. Me personally follows Google Objective-C Style Guide.
Upvotes: 0
Reputation: 31722
Here is apple documented coding guidelines, which uses style #2 (space after -)
There are two blog tutorial with examples ..
http://cocoadevcentral.com/articles/000082.php
http://cocoadevcentral.com/articles/000083.php
Upvotes: 3