开发者

Class methods and self keyword in objective-c [duplicate]

This question already has an answ开发者_运维技巧er here: Closed 11 years ago.

Possible Duplicate:

“Invalid use of 'this' in non-member function” in objective-c context?

If I use the keyword self inside a class method:

+ (id) myMetho
{
   self ...
}

Does it refer to the class or to the current instance ?


In short, it represents the class. For a longer answer, have a look here


self just means "the class you are in"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜