Greetings Programs!
This issue does not occur when using XCode 4.6 and iOS6 but the minute I change it to iOS7, it pops up. It probably has to do with the number of views I need to load and the time each one needs and the way iOS7 handles things BUT it ONLY occurs (so far anyways) when I place a MKMapView in the same view.
I have this:
Tab Bar Controller
+--- Navigation Controller
+--- View Controller
+--- Container View1
+--- SCSearchViewController1
+--- Search Bar
+--- TableView
+--- Container View2
+--- SCSearchViewController2
+--- MKMapView
+--- Container View3
+--- SCSearchViewController3
+--- Search Bar
+--- TableView
+--- Container View4
+--- SCSearchViewController4
+--- Search Bar
+--- TableView
Now, it didn't matter if the MKMapView was in the container view or the view controller, the app would crash whenever the view would load; it would sometimes give a message about an invalid selector or nothing.
I found that it was crashing at that point when I replaced the default tableViewModel with the new objectsModel:
self.tableViewModel = objectsModel;
To solve the problem of crashing, I set a short delay before assigning it.
double delayInSeconds = 0.1; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ weak_self.tableViewModel = objectsModel; });
Any thoughts on other solutions?
Wg