Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

NavigationController programmatically

gbergamogbergamo Posts: 107Registered Users
edited May 2011 in iPhone SDK Development
Hello (again!)

I have to make a navigation controller programatically.

I do exactly:

create a file (UIViewController)
delete the view
create a window
link the IBOutlet in File's owner like a View
create a UINavigationController
link the window's rootViewController with UINavigationController

In Interface Builder I have this:
[Window]
(rootViewController)---(Navigation Controller)
(View)---(File's Owner)

I make everything in "Interface Builder"

The problem: I have the code:

- (IBAction)addPlace:(id)sender {
AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@\"AddPlacePart2Controller\" bundle:nil];
[self.navigationController pushViewController:controller animated:YES];
[controller release];
}


After press a button and execute this code block, don't happen anything...
No error and no view change...

Someone, please??
Post edited by gbergamo on
Vai de Que? - Car supplies Util - Download

iJob - Job search (Br) - Download

Replies

  • gbergamogbergamo Posts: 107Registered Users
    edited May 2011
    gbergamo;333991 said:
    Hello (again!)

    I have to make a navigation controller programatically.

    I do exactly:

    create a file (UIViewController)
    delete the view
    create a window
    link the IBOutlet in File's owner like a View
    create a UINavigationController
    link the window's rootViewController with UINavigationController

    In Interface Builder I have this:
    [Window]
    (rootViewController)---(Navigation Controller)
    (View)---(File's Owner)

    I make everything in "Interface Builder"

    The problem: I have the code:

    - (IBAction)addPlace:(id)sender {
    AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@\"AddPlacePart2Controller\" bundle:nil];
    [self.navigationController pushViewController:controller animated:YES];
    [controller release];
    }


    After press a button and execute this code block, don't happen anything...
    No error and no view change...

    Someone, please??
    No one?
    Vai de Que? - Car supplies Util - Download

    iJob - Job search (Br) - Download
  • ngaikwadngaikwad Posts: 462Registered Users
    edited May 2011
    gbergamo;334286 said:
    No one?
    why Are you not using the already giving the navigation application in xcode
    Thank & Regard

    NI3(Not Impossible 3)
  • dany_devdany_dev Posts: 4,700Tutorial Authors, Registered Users
    edited May 2011
    - (IBAction)addPlace:(id)sender {
    NSLog(@\"addPlace-Started\");
    AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@\"AddPlacePart2Controller\" bundle:nil];
    [self.navigationController pushViewController:controller animated:YES];
    [controller release];
    NSLog(@\"self.navigationController:%@\",self.navigationController);
    }


    what you see in console?
  • gbergamogbergamo Posts: 107Registered Users
    edited May 2011
    dany_dev;334291 said:
    - (IBAction)addPlace:(id)sender {
    NSLog(@\"addPlace-Started\");
    AddPlacePart2Controller *controller = [[AddPlacePart2Controller alloc] initWithNibName:@\"AddPlacePart2Controller\" bundle:nil];
    [self.navigationController pushViewController:controller animated:YES];
    [controller release];
    NSLog(@\"self.navigationController:%@\",self.navigationController);
    }


    what you see in console?

    2011-05-13 17:01:23.036 Unear[4191:207] addPlace-Started
    2011-05-13 17:01:23.039 Unear[4191:207] self.navigationController:(null)


    You found my problem! There's no navigationController finded by the code.
    But.. how resolve this?

    thanks
    Vai de Que? - Car supplies Util - Download

    iJob - Job search (Br) - Download
  • gbergamogbergamo Posts: 107Registered Users
    edited May 2011
    ngaikwad;334288 said:
    why Are you not using the already giving the navigation application in xcode
    Because, when I open the view addPlace, I open it with a viewController, like another part of app. And this part would be accessed in other place.
    Vai de Que? - Car supplies Util - Download

    iJob - Job search (Br) - Download
  • dany_devdany_dev Posts: 4,700Tutorial Authors, Registered Users
    edited May 2011
    basically you need to put a reference of navigationController somewhere (in a singleton or in appdelegate) so that you can retrieve it and use...
Sign In or Register to comment.