PDA

View Full Version : Before I pull my hair out!




Abunga
Apr 26, 2011, 09:46 AM
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.


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:



dejo
Apr 26, 2011, 09:59 AM
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 (http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/Introduction/Introduction.html%23//apple_ref/doc/uid/TP40007457)? 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.

Abunga
Apr 26, 2011, 10:05 AM
Thanks Dejo, thought it might be wrong.

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

:rolleyes:

robbieduncan
Apr 26, 2011, 10:56 AM
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.

jnoxx
Apr 27, 2011, 02:23 AM
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

robbieduncan
Apr 27, 2011, 04:24 AM
Im with Duncan on this one..

Gaaaah. Why do people keep choosing to call me Duncan? That's my surname. Either use the full username or the first part.

jnoxx
Apr 27, 2011, 05:13 AM
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)

Abunga
Apr 28, 2011, 01:14 PM
Much appreciated for the help, i didn't think about hiding the bar. :o