Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个类的自定义初始化程序:
- (id) initWithBlah:(NSString *)blah{ // do random stuff with blah and return self }
如何以另一种方法访问分配给“blah”的字符串?
- (void) getBlah { // get value of blah here from initializer }
有任何想法吗?
阅读属性:https ://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html