Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Abunga

macrumors newbie
Original poster
Jan 25, 2011
15
0
Please help!

I have been trying all day to simply move to another view once a button is pressed. I don't want a navigation or tool bar on my app.

I am completely lost as how to sort this. Every example and written text shows navigation stacks and such, but none of them have worked when implementing it to my test app.

In simple: I have a single view that has a button on it. This button is linked to an action. When this action is started, it runs a 'pushViewController' script.

Code:
RedView *redView2 = [[RedView alloc] initWithNibName:@"RedView" bundle:nil];
	
[self.navigationController pushViewController:redView2 animated:YES];
[redView2 release];

Nothing happens.

Although this seems simple to some and ridiculous to others, it is one of two or three different methods i have tried.

Is it that this is the the wrong way to go about it when not using navigation/tool bars?

Where can i find the help i need. I find the Apple documentation never answers the questions i ask. After a day trying to sort this SIMPLE task, it is wearing me thin. :mad:
 
Is it that this is the the wrong way to go about it when not using navigation/tool bars?
Yes, that's the wrong way. Since self.navigationController will be nil.

Where can i find the help i need. I find the Apple documentation never answers the questions i ask. After a day trying to sort this SIMPLE task, it is wearing me thin. :mad:
Have you looked at the View Controller Programming Guide for iOS? Also, you might want to create a project based on the Utility Application template; that shows how to have a new view displayed in reaction to a button push.
 
Thanks.

Thanks Dejo, thought it might be wrong.

Will look this up. Strangely, i was just reading about Utility Apps.

:rolleyes:
 
I'd use a navigation based app and just hide the navigation bar (it's easy: look in the documentation). That way you can push and pop view controllers without any problems.
 
Im with Duncan on this one..
Just create a navigationController, use the easy functionality, but just hide the topbar.
And u can push/pop controllers with code instead of using the buttons on the top.
That should set you on the right way
 
Gaaaah. Why do people keep choosing to call me Duncan? That's my surname. Either use the full username or the first part.


Gaaaah. I saw your post about this in another post, but it was after i posted (u post?! i mean understand.)
I'm sorry *bow down*. On iphonedevsdk was a guy called Duncan too, so I got used to it, sorry Robbie Or RobbieDuncan x)
 
Much appreciated for the help, i didn't think about hiding the bar. :eek:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.