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

View Single Post
Old 03-19-2009, 01:53 PM   #1 (permalink)
jchoi1009
New Member
 
Join Date: Mar 2009
Posts: 18
jchoi1009 is on a distinguished road
Default UIBarButtonItem customView action

Hello,

I have a UIToolbar filled with 5 UIBarButtonItems.
For the UIBarButtonItems, I am using a custom view like this:
Code:
button = [[UIBarButtonItem alloc] initWithCustomView:[[UIImageView alloc] initWithImage:image]];
button.action = @selector(myaction);
button.target = self;
The problem is, clicking on this button doesn't trigger myaction.
How do you use a custom view for UIBarButtonItem and make action work?

Or yet even better, is there a way to do initWithImage for UIBarButtonItem without losing original colors?
jchoi1009 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,628
Threads: 94,087
Posts: 402,798
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brainusa
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.