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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-08-2010, 03:17 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 60
racharambola5 is on a distinguished road
Default Doubt in UIAlertView

Hi,
I have a small doubt. I have a NSObject class where I am trying to display an alert view. So after the alert view is displayed when I tap on OK button I want to push a navigation controller onto the stack. Can I push a navigation controller from general NSObject class? Please let me know guys..thanks for your time.
racharambola5 is offline   Reply With Quote
Old 09-08-2010, 04:00 PM   #2 (permalink)
Registered Member
 
kelvinkao's Avatar
 
Join Date: Jul 2009
Location: Los Angeles
Posts: 352
kelvinkao is on a distinguished road
Send a message via AIM to kelvinkao
Default

You can push it from whichever class as long as you can get a reference to the navigation controller.
__________________
My dev blog:
http://www.kelvinkaodev.com
kelvinkao is offline   Reply With Quote
Old 09-08-2010, 04:07 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 60
racharambola5 is on a distinguished road
Default

I used alert view's clickedButtonAtIndex method and I tried to create navigation controller's class variable..

Code:
 ModuleViewController *homeView = [[ModuleViewController alloc] initWithNibName:@"ModuleViewController" bundle:nil];
    [self.navigationController pushViewController:homeView animated:NO];
    [homeView release];
So when I reference self.navigationController it says that this class may not respond..can you please help me..thanks for the reply
racharambola5 is offline   Reply With Quote
Old 09-08-2010, 04:12 PM   #4 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 864
nobre84 is on a distinguished road
Default

homeView is the View Controller you want to show. You need to show it FROM somewhere (a navigation controller, if you want to push it onscreen).
You have a NSObject, do you have a navigationController property declared in your class ? Is it of type UINavigationController ? Do you have it properly set up ?
All of these must be good in order to work.
nobre84 is offline   Reply With Quote
Old 09-08-2010, 04:38 PM   #5 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 60
racharambola5 is on a distinguished road
Default

So, I made navigation controller a property now in NSObject class and I am using this property in the clickedButtonAtIndex method but nothing happens..
racharambola5 is offline   Reply With Quote
Old 09-08-2010, 05:34 PM   #6 (permalink)
Fly-by-night Innovator
 
Join Date: Jun 2010
Posts: 364
musicwind95 is on a distinguished road
Default

self should be an instance of UINavigationController, not just NSObject.

Check out the NavBar sample code for info on how to put together a nav structure.

Then, when the alert is dismissed, just use the code you have above.

Hope this helps!
__________________
If I have helped you, please consider donating. I use PayPal. It would mean a lot to me!


For more iOS Development, check out my blog—Cups of Cocoa. All visitors welcome, but especially beginners!

Hope I have helped!

Please check out IceFall, a new action game available in the App Store!
musicwind95 is offline   Reply With Quote
Reply

Bookmarks

Tags
iphone, objective-c, uialertview, uinavigationcontroller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 333
10 members and 323 guests
bignoggins, carlandrews, flamingliquid, hzwegjxg, ilmman, jenniead38, linkmx, nadav@webtview.com, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0