samedi 25 avril 2015

Why some Cocoa Touch APIs use this method declaration


Almost all Cocoa Touch APIs use this method defination and i just wonder why used like this instead of other notations?

NSString *trimString(BOOL useComma) {
    ...
    return @"";
}

Thanks to above method declaration I'll use like this without self sign;

trimString(YES)

So i really wonder why all APIs use this notation. Thank you!


Aucun commentaire:

Enregistrer un commentaire