Table not loading data after adding SWRevealViewController

别来无恙 提交于 2019-12-11 18:06:27

问题


After a bit of bungling I have added a reveal view controller to my app but now it doesn't seem to be loading the data.

I can't see where my changes would have affected that aspect of the app.

in didFinishLaunchingWithOptions I changed

STRTableViewController *tableViewController = [(UINavigationController *)self.window.rootViewController viewControllers][0];
self.delegate = tableViewController;

to the following since the rootViewController is no longer the table view:

// in .m interface 
@property (nonatomic, strong) STRTableViewController *tableViewController; 
...
// in didFinishLaunchingWithOptions
self.tableViewController = [[STRTableViewController alloc] init];
self.delegate = self.tableViewController;

and then (also in AppDelegate) I'm calling a tableViewController method to fetch and load the table data with

- (void)loadTableViewData
{
   [self.tableViewController loadTableData]
}

Also, a bit more info. On first launch, the app loads some dummy data and goes through a short tutorial. At the end of the tutorial the app requests location services and then loads the actual data in the table based on if the user accepts or uses reverse geolocation instead. The dummy data loads for the tutorial but the actual data does not.

Both were loading in the table view perfectly fine before adding the reveal VC so I'm not sure why this would change with the small change I made here.

Any suggestions would be greatly appreciated.

Thanks!

来源:https://stackoverflow.com/questions/22773205/table-not-loading-data-after-adding-swrevealviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!