Table not loading data after adding SWRevealViewCo

2019-09-05 23:06发布

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!

0条回答
登录 后发表回答