【发布时间】:2016-08-11 15:46:15
【问题描述】:
问题描述如下:
- NSObject中包含的UIViewController链接函数中包含的函数
- NSObject 将值返回给 UIViewController 中包含的另一个函数
- 当一个函数引用到 UIViewController 时,它不会更新 UILabel
在 UIViewController 中找到 UILabel
NSObject 类:
-(void)getCategoryId:(NSString *)categoryid {
categoryMap *catMap = [[categoryMap alloc] init];
[catMap getCategoryId:categoryid];
catMap.nePOI = categoryid;
}
UIViewController:
-(void)getCategoryId:(NSString *)categoryid {
self.label.text = categoryid;
}
【问题讨论】:
-
@TejaNandamuri 我写了一个问题的例子。默认情况下,有一些准则。我呼吁在当地正常运作。
-
当值改变时可以使用Delegate(协议)传递数据。此外,NSNotificationCenter 也是一个不错的选择。
标签: ios objective-c uiviewcontroller iboutlet