标签: objective-c ios
假设我有一个类的自定义初始值设定项:
- (id) initWithBlah:(NSString *)blah{ // do random stuff with blah and return self }
如何在另一种方法中访问分配给“blah”的字符串?
- (void) getBlah { // get value of blah here from initializer }
有什么想法吗?
答案 0 :(得分:0)
阅读属性:https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html