ios - How to change the class assigned in app delegate -


i using refrostedviewcontroller showing slide-in menu.and it's working fine in application .i got situation have modify uitableview data-source;like have change value in nsarray displaying in table , doing fine .but problem refrostedviewcontroller instance created in appdelegate , @ instance of demomenuviewcontroller gets created in appdelgate used throughout application life cycle until user quits application .

demonavigationcontroller *navigationcontroller = [[[demonavigationcontroller alloc] initwithrootviewcontroller:[[[searchviewcontroller alloc] init]autorelease]]autorelease]; demomenuviewcontroller *menucontroller = [[[demomenuviewcontroller alloc] initwithstyle:uitableviewstyleplain]autorelease];  // create frosted view controller  refrostedviewcontroller *frostedviewcontroller = [[[refrostedviewcontroller alloc] initwithcontentviewcontroller:navigationcontroller menuviewcontroller:menucontroller]autorelease]; 

my issue want change demomenuviewcontroller can use modified/chnaged instance in refrostedviewcontroller. if restart application got new values inthe application want new instance gets created upon relaunching app.

edit

stituation:application launch , have 3 menu item search,login,aboutus when user logged in need change menu new item 12 new item.for changed datasoure using condition userin working fine got new array.but demomenuviewcontroller never gets called again. instance created in appdelegate.

what want have new demomenuviewcontroller instance refrostedviewcontroller when got log in application.

i want achieve below:

_menuviewcontroller=[[demomenuviewcontroller alloc]init];  refrostedviewcontroller *view=[appdelegateinstance frostedviewcontroller1]; uinavigationcontroller *navigationcontroller=[appdelegateinstance navigationcontroller]; view=[[refrostedviewcontroller alloc] initwithcontentviewcontroller:navigationcontroller menuviewcontroller:_menuviewcontroller]; [appdelegateinstance frostedviewcontroller1]=view; 

i solved issue modifying rootviewcontroller

demonavigationcontroller *navigationcontroller = [[[demonavigationcontroller alloc] initwithrootviewcontroller:[[[searchviewcontroller alloc] init]autorelease]]autorelease];                 demomenuviewcontroller *menucontroller = [[[demomenuviewcontroller alloc] initwithstyle:uitableviewstyleplain]autorelease];                  // create frosted view controller                 //                 refrostedviewcontroller *frostedviewcontroller1 = [[[refrostedviewcontroller alloc] initwithcontentviewcontroller:navigationcontroller menuviewcontroller:menucontroller]autorelease];                  frostedviewcontroller1.direction = refrostedviewcontrollerdirectionleft;                 frostedviewcontroller1.liveblurbackgroundstyle = refrostedviewcontrollerlivebackgroundstylelight;                 frostedviewcontroller1.liveblur = yes;                 frostedviewcontroller1.delegate = self;                  [uiview transitionwithview:self.view                                   duration:0.5                                    options:uiviewanimationoptiontransitionflipfromleft                                 animations:^{ [[appdelegateinstance window] setrootviewcontroller:frostedviewcontroller1]; }                                 completion:nil]; 

Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -