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

View Single Post
Old 10-03-2008, 11:09 AM   #3 (permalink)
rames44
Mobile Geek
 
Join Date: Aug 2008
Location: Florida, USA
Posts: 365
Send a message via AIM to rames44 Send a message via Yahoo to rames44
Default

When you say "didn't work" do you mean that it didn't display as you wanted? Or that it didn't give you the result you expected? It looks like you've installed it correctly (so I would expect it to display) but you haven't configured it properly, so I would not expect it to work when pressed.

The one thing I noticed odd was the "action" you supplied when creating the BarButtonItem. Normally, the init code should look like:
Code:
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:btnItem target:self action:@selector(myMethod)];
where "myMethod" is a member function on the view controller that's setting this ("self") up.

What you've done is said that the target object (the object that will be called when the button is pressed) is "self", but that the action (the actual method that will be called) is whatever method (heaven only knows what) that was on the original left button item. Your view controller ("self") almost certainly doesn't implement a method by that name (whatever it is), so when the button is pressed, the system's not going to be able to call anything rational - it won't find the method, so probably nothing will happen.
rames44 is offline   Reply With Quote
 

» Advertisements
» Online Users: 751
20 members and 731 guests
cbrauchli, ChenXin, chits12345, gc2010, Grace.H, gurumoorthy, ilmman, JamesCahall, kaileymo123, Lanka001, Leoknico, mapiko, mikeporras, Moe2392, MozyMac, nidie, rrlemoine, sacha1996, xlc
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,813
Threads: 89,206
Posts: 380,630
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Leoknico
Powered by vBadvanced CMPS v3.1.0

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