Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 04-05-2009, 01:33 AM   #2 (permalink)
erfmufn
iPhone Neophyte
 
Join Date: Mar 2009
Posts: 41
Default

Well through some trial and error I've worked out I don't need a third controller and I can call a switch method in the delegate which is pretty neat. Now my only problem is that it ignores the landscape orientation I've set.

Code:
- (void)switchView 
{
    if (instructionsViewController == nil)
    { 
        [viewController.view removeFromSuperview];
        [viewController release];
        viewController = nil;
		
        instructionsViewController = [[InstructionsViewController alloc]init];
        [window addSubview:instructionsViewController.view];
    }
    else
    {
        [instructionsViewController.view removeFromSuperview];
		[instructionsViewController release];
		instructionsViewController = nil;
		
		viewController = [[PianoTutorViewController alloc]init];
        [window addSubview:viewController.view];
    }
}
Not sure if code is elegant, but works apart from the landscape issue.
erfmufn is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,718
Threads: 89,177
Posts: 380,483
Top Poster: BrianSlick (7,120)
Welcome to our newest member, korting
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:09 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.