Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-17-2009, 01:26 PM   #1 (permalink)
mbarron
Registered Member
 
Join Date: Jun 2009
Posts: 28
Default removing (or identifying) the default view

I'm having trouble removing the default view in a iPhone app. I started with a view based app and want to have button that simply changes to a settings page. I set up the main view with a button called "settings". I set up the settings view. I was able to hook the settings up to its own controller and then in the controller for the main page add this action. This works, but puts the new view behind the start view, so I can see the settings button on the settings page.

Quote:
-(IBAction) startSettings: (id)sender { SettingsViewController *settingsControllerview = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil]; [self.view insertSubview:settingsControllerview.view atIndex:0]; }
So I figured I just need to remove the first view. I thought this would work:

Quote:
[viewController.view removeFromSuperview];
Because that's how the delegate originally added it
Quote:
[window addSubview:viewController.view]; [window makeKeyAndVisible];
But no such luck. So I'm really confused. Obviously, I've got the wrong name for the existing view, but how do I discover what the correct name is?

Any guidance would be greatly appreciated, I've been tearing my hair out for three hours on this.
mbarron is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 283
18 members and 265 guests
acmecorps, alex_ivanov, ChrisMayer, darrenmj, dmerat, dvaii, Erythema, ianian, iGeorG, jyu, kmadhukishore, Lokendra, markdude, oldmicah, Pilly170, refreshe, robertsechenfen, Rossco
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,238
Threads: 39,016
Posts: 171,113
Top Poster: smasher (2,570)
Welcome to our newest member, Erythema
Powered by vBadvanced CMPS v3.1.0

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