iphone - UI blocks while pushing view controller on to navigation controller -
i have moved ios 5 project ios 6 environment (since apple made mandatory support 4-inch device compability) , having bit of problem while pushing uiviewcontroller on uinavigationcontroller.
after push custom uiviewcontroller, user interface blocks 5 20 seconds, when pushing custom uiviewcontroller first time. if pop uiviewcontroller , push again, there no delay or ui block.
here happens;
first pushing uiviewcontroller uitableviewcontroller's didselectrowatindexpath (custom init works fine, no issue there)
campaigndetailviewcontroller *detailviewcontroller = [[campaigndetailviewcontroller alloc] initwithproduct:selectedproduct]; [self.navigationcontroller pushviewcontroller:detailviewcontroller animated:yes]; than logging (i cleared code in viewdidload, viewwillappear , viewdidappear, means pushing controller should load nib)
on pushed uiviewcontroller;
- (id)initwithproduct:(product *)selectedproduct { nslog(@"starting init"); self = [super initwithnibname:@"campaigndetailviewcontroller" bundle:nil]; nslog(@"nib loaded"); if (self) { self.navigationitem.title = selectedproduct.name; self.product = selectedproduct; } nslog(@"finishing init"); return self; } - (void)viewdidload { nslog(@"starting viewdidload"); [super viewdidload]; nslog(@"finishing viewdidload"); } - (void)viewwillappear:(bool)animated { nslog(@"view appear"); } - (void)viewdidappear:(bool)animated { nslog(@"view did appear"); } debugger log;
2013-05-03 12:33:49.678 my-app[1429:707] starting init 2013-05-03 12:33:49.680 my-app[1429:707] nib loaded 2013-05-03 12:33:49.683 my-app[1429:707] finishing init 2013-05-03 12:33:49.808 my-app[1429:707] starting viewdidload 2013-05-03 12:33:49.855 my-app[1429:707] finishing viewdidload 2013-05-03 12:33:49.861 my-app[1429:707] view appear 2013-05-03 12:35:28.501 my-app[1429:707] view did appear there on 30 seconds of delay between viewwillappear , viewdidappear.
further info
- i have tried use regular
init, removed nib file, nothing changed. - nothing gets loaded in between of pushviewcontroller , loading uiviewcontroller.
- this issue happens on iphone 4 - ios 5 device. works fine on ios 5 , 6 simulators works fine on iphone 5 - ios 6 device.
- i pushing other view controllers on other parts of project well, uiviewcontroller seems issue.
- view controller pushed on main thread, , therefore view controller loaded on main thread
- during blocked period, xcode (4.6.1) gets blocked , not responds well
two hints:
1 - issue happening on simulator or on real device? i've experienced many unexpected delays on simulator.
2 - remember call
[super viewwillappear:animated]; and
[super viewdidappear:animated]; inside impelentations.
from apple documentation:
if override method, must call super @ point in implementation.
Comments
Post a Comment