ios - Tabbed application won't show Login view -


i have tab bar application in xcode 4.3 , i'm trying insert login screen before tabbar shown. app works ok if presentmodalviewcontroller has animated:yesbut if without animation view not showing.

@synthesize window = _window;  @synthesize tabbarcontroller = _tabbarcontroller;  - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions {     self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]];     // override point customization after application launch.     uiviewcontroller *viewcontroller1 = [[firstviewcontroller alloc] initwithnibname:@"firstviewcontroller" bundle:nil];     uiviewcontroller *viewcontroller2 = [[secondviewcontroller alloc] initwithnibname:@"secondviewcontroller" bundle:nil];      self.tabbarcontroller = [[uitabbarcontroller alloc] init];     self.tabbarcontroller.viewcontrollers = [nsarray arraywithobjects:viewcontroller1, viewcontroller2, nil];     self.window.rootviewcontroller = self.tabbarcontroller;      loginviewcontroller *logviewcontroller = [[loginviewcontroller alloc] initwithnibname:@"loginviewcontroller" bundle:nil];     [self.window addsubview:_tabbarcontroller.view];      [self.tabbarcontroller presentmodalviewcontroller:logviewcontroller animated:yes];     //this wont work     //[self.tabbarcontroller presentmodalviewcontroller:logviewcontroller animated:no];      [self.window makekeyandvisible];     return yes;  }  -(void)logindone{      nslog(@"back app delegate");    [self.tabbarcontroller dismissmodalviewcontrolleranimated:yes];   } 
  1. is right way it?
  2. why wont code work animated:no ?
  3. i on output unbalanced calls begin/end appearance transitions <uitabbarcontroller: 0x689d350>.

first of all, move [self.window makekeyandvisible]; before view controller setup.

additionally, should presenting modal view controller within viewwillappear: method of view controller visible first, make sure apps view hierarchy has been initialized before presenting login screen.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -