Selector with arguments

Hi experts,

I'm really new to iOS programming (a week in fact) and I was wondering if anyone could tell me how to pass a selector with arguments in a method.

I get the "Expected ')'  before '(' token error.

How do I do this correctly?
Thanks in advance.
// This is the method
-(void)setIsEditing:(BOOL)editing


// This is what I'm trying to do and should be doing according to the documentation, but it gives an error
      UIBarButtonItem* rightButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(setIsEditing:YES)];

Open in new window

LVL 2
SnapplesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SpeedyApocalypseCommented:
You can send information with the selector using UserInfo.  For example, create an NSDictionary and add some objects and keys to it.  When the method is called, you are able to receive that userinfo.

For example, set up your selector method like so:

-(void)myMethod:(NSTimer *)theTimer {

}

Open in new window


Then retrieve the information in your userInfo by doing something along the lines of...

NSDictionary *myNewDict = theTimer.userInfo; // I forgot the exact code off hand...

Open in new window


This thread contains some valuable information for you on this topic:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/48724-nstimer-selector-userinfo.html


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.