这是一个非常基本的问题。 在AppDelegate.m
,其他类中陈述的引用变量
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.stationInfos = [StationDB database].stationInfos;
}
return YES;
}
,我希望能够用stationInfos
从我ViewController.m
内。最常用的方法是什么?
为什么不能从视图控制器调用'[StationDB数据库] .stationInfos'? – 2015-02-06 17:35:33
可能还有其他需要'stationInfos'的类。在那种情况下,在AppDelegate.m中是否有正确的决定? – 2015-02-06 18:31:35