【发布时间】:2011-06-29 09:43:21
【问题描述】:
可能重复:
What do the plus and minus signs mean in Objective C next to a method?
我在课堂上对 -(type) 和 +(type) 感到困惑。
@interface Class:Something{
+(id) foo;
-(void) fooAgain;
}
+(type) 是类级函数(根据谷歌) 但我不明白类级函数的含义。 +(id)foo 里面有点 {return some value} 我认为它类似于 getter 或 setter 但不知何故它必须不同。 (因为@property 指的是getter/setter)
谁能简单解释一下?谢谢
【问题讨论】:
标签: iphone objective-c ios class syntax