views:

47

answers:

3

Hi
How can I handle different views in XCode?
Let's say I want to show a different view when the user press a button.

UIViewController *viewSettings;
[viewSettings initWithNibName:(NSString *)@"SettingsViewController" bundle:(NSBundle *)nil];

This code don't work. The app crashes.

I have updated my XCode to the new version. How can I say my projects that they have to take the new SDK?

Thanks.

A: 

1) You use a UIViewController to manage the view stack and ultimately which view is visible.

2) In your xCode project, modify the project or target "Base SDK" property. This will let you choose the minimum version of iOS to require of your users.

MystikSpiral
A: 

You need to read the Apple documentation for view controllers There are also some very good beginner books out there for iPhone programming

brown.2179
OK. Why did this code don't work? SettingsViewController *viewSettings = [SettingsViewController alloc]; NSLog(@"UIViewController init"); [viewSettings initWithNibName:(NSString *)@"SettingsViewController" bundle:(NSBundle *)nil]; [viewSettings loadView];
Eragonio
A: 

This is the correct line. Then you need to push it (pushViewController) onto a UINavigationController or add it to an existing view. Do a Google search for iPhone Beginner Tutorial First Application or something like that.

UIViewController *viewSettings = [SettingsViewController initWithNibName:@"SettingsViewController" bundle:nil];
Jordan