Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Changing the view controller from the AppDelegat 2nd time

obaidjawadobaidjawad Posts: 133Registered Users
Hi, I'm trying to change the view from the appdelegate class for the second.

The scenario is I have the AppDelegate class in which I first loaded the 1stviewcontroller from didfinishlaunching, and then in the 1stviewcontroller I have some parameters like comparing, and then the cotrol flow is passing to the Appdelegate class in which it is comparing the values, and if the comparison fails I want the 2ndviewcontroller to be loaded and if the comparison is true it should be on the 1stviewcontroller

So, for that I have tried to switch the views as we usually do.

SMLoginViewController *loginController = [[SMLoginViewController alloc] init];
[self presentModalViewController:loginController animated:YES];

image and it gives me this error when I declare this in the AppDelegate class. Is there a other way to switch to the view controllers'' from AppDelegate class?
Post edited by obaidjawad on

Replies

  • bcilbcil Posts: 9New Users
    Hi, I'm still a newbie but I lost 2 days implementing a switching method that works correctly...

    The first version was using as you the presentModalViewController and I had some many troubles that I have changed for classes with views and the following command :

    ChildViewController* viewLoginController = [[ChildViewController alloc] init];
    [viewLoginController initWithData:datamanager];
    [viewLoginController.view setFrame:CGRectMake( 0.0f, 480.0f, 320.0f, 480.0f)];
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight
    forView:viewLoginController.view
    cache:YES];
    [mastercontroller.view addSubview:viewLoginController.view];
    [self.window makeKeyAndVisible];
    [UIView commitAnimations];
Sign In or Register to comment.