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 12-28-2009, 08:55 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 32
Question UIBarButtonItem NOT sending Action

Ok guys i am stumped.

My setup is for navigation-based application. Within IB, the XIB view controller being loaded in contains my main display. Within this display is a UIView. Within the UIView is a UIToolbar. Within the UIToolbar is a UIBarButtonItem.

I've created a method within the back-end view controller class to handle the bar button item. Within IB i associate the "Sent Actions" - Selector to the File Owner (MyUIViewController) method "BarButton_Click".

For the record i also tried creating the bar button item programmatically within the view controller View_load and adding to the IBOutlet toolbar:

UIBarButtonItem *bb = [[UIBarButtonItem alloc] initWithTitle: @"Click Me" style:UIBarButtonItemStyleBordered target:self action:@selector(BarButton_Click:)];

[tb setItems:[tb.items arrayByAddingObject:bb]];


When i run the simulator to test the bar button item being clicked, there is no action being sent to the method.

Any ideas why?

I am using iphone sdk v 2.2.1

Thanks

Last edited by quantass; 12-28-2009 at 09:11 PM.
quantass is offline   Reply With Quote
Old 12-28-2009, 09:54 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 32
Default

Ok I discovered what was preventing the bar button from sending the action to my method. I must have accidentally unchecked "User Interaction Enabled" in IB for the UIView parent containing my toolbar. This had the effect of not sending any actions to my method.

Thanks.

Last edited by quantass; 12-28-2009 at 10:03 PM.
quantass 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: 340
18 members and 322 guests
ADY, Dani77, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, macquitzon216, mer10, Monstertaco, prchn4christ, Robiwan, sly24, Touchmint, twerner, zulfishah
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,760
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:39 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0