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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 10-06-2008, 08:05 AM   #1 (permalink)
Registered Member
 
Join Date: Oct 2008
Posts: 42
Default Changing views from Navigation controller

Hi guys,

I am having some problems with changing views when I click on "Settings" button of navigation controller. To be more specific, here is my initialization code(for the button):
Code:
- (id)initWithStyle:(UITableViewStyle)style {
    // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
    if (self = [super initWithStyle:style]) {
        self.title = @"pingdom";
        UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
                                       initWithTitle:NSLocalizedString(@"Settings", @"")
                                       style:UIBarButtonItemStyleBordered
                                       target:self
                                       action:@selector(GoToSettings:)];
        self.navigationItem.rightBarButtonItem = addButton;
    }
    return self;
}
and here is the function where I tell my app delegate to change view
Code:
-(void) GoToSettings {
    LuckyAppDelegate *md = (LuckyAppDelegate *)[[UIApplication sharedApplication] delegate];
    [md CheckViewToSettingsView:self];
}
When I use this code outside the button function it works flawlessly. However, inside it, it just pops up debugger mode.

I hope that you understand my problem and have the appropriate solution

Regardz,
Mladen
mladjo is offline   Reply With Quote
Old 10-06-2008, 08:53 AM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

Not sure why you see the debugger but the selector for the action method isn't correct.

Code:
@selector(GoToSettings:)
doesn't match

Code:
-(void) GoToSettings
The colon at the end means there's a parameter, and there isn't one.

These match:

Code:
@selector(GoToSettings)
-(void) GoToSettings
and these match

Code:
@selector(GoToSettings:)
-(void) GoToSettings:(id)sender
PhoneyDeveloper is offline   Reply With Quote
Reply

Bookmarks

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: 252
17 members and 235 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

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