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

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
Hi there,

I used the code below to navigate between UITableViewController.

SearchAthleteNameViewController *searchAthletesVC = [[[SearchAthleteNameViewController alloc] initWithNibName:storyLink bundle:nil] autorelease];
[self.navigationController pushViewController:searchAthletesVC animated:YES];

Where SearchAthleteNameViewController is an instance of another UItableViewController (another .xib file).

Now, I have to navigate to NSObject from an UItableViewController. I tried using the same, i cannot find the method, initwithNibName to make it navigate. And also it shows an warning in the next line & a cfrunloop prevails.

can some one suggest/send sample code for me to make it run? Please!
 

CocoaPuffs

macrumors 68020
Aug 23, 2008
2,005
3
Instance of UINavigationBar should be stored within App Delegate, and you should push the view from that instance.

Thus your code:
Code:
[self.navigationController pushViewController:searchAthletesVC animated:YES];
Suggests that you are not doing that. Perhaps what you are looking for is modal view:
Code:
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
Thanks For the response CocoaPuffs. you are right, But I am a very very newbie to what u said. Can you please explain me in brief if time permits/ can you send me some code samples for the same? Please!!!

Also, the particular line:

Instance of UINavigationBar should be stored within App Delegate, and you should push the view from that instance.

its new to me.

Also, i am performing this action (moving inbetween the xib's) in a tableview's didSelectRowAtIndexPath method.

Can you please guide me?
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
I tried using this,

modalViewController = [[WebBrowserTutorialAppDelegate alloc] initWithNibName:mad:"MainWindow_webbrowser" bundle:nil];

but i am not able to get the method, initWithNibName. if i override that, no warning appears. but ends the app due to uncaught exception.

please help me!
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
Some one help me how to use the appdelegate method please!!!!!!

I am struck!
 

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
Instance of UINavigationBar should be stored within App Delegate, and you should push the view from that instance.

Thus your code:
Code:
[self.navigationController pushViewController:searchAthletesVC animated:YES];
Suggests that you are not doing that. Perhaps what you are looking for is modal view:
Code:
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated
You don't need to access the appDelegate at all to do what he's doing. It's perfectly fine to use self.navigationController in this way.

The problem is then navigating to an NSObject - the question is why on earth would you want to? The only things you should be pushing are UIViewController subclasses.
 

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
Thanks for the post caveman_uk.
Still I am struck.

[self.navigationController pushViewController:searchAthletesVC animated:YES];

is not helping me right now. Also it says, Warning:passing 2 of
'initnibname:bundle:' makes pointer from integer without a cast


in :

ProfileViewerController *newprofiler = [[[ProfileViewerController alloc] initWithNibName:storyLink bundle:YES] autorelease];

the profileviewercontroller is an instance of a uiview xib file.

I cant find the cause of the error still.

Can you please help me on this/ Please!
 

CocoaPuffs

macrumors 68020
Aug 23, 2008
2,005
3
You don't need to access the appDelegate at all to do what he's doing. It's perfectly fine to use self.navigationController in this way.

The problem is then navigating to an NSObject - the question is why on earth would you want to? The only things you should be pushing are UIViewController subclasses.

I figured he's using it everywhere. If he is just trying to navigate between two view, modal view is simpler.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.