Re: Application runs multiple times
Re: Application runs multiple times
- Subject: Re: Application runs multiple times
- From: Jerry Krinock <email@hidden>
- Date: Sun, 10 Dec 2006 05:22:45 -0800
- Thread-topic: Application runs multiple times
on 06/12/10 3:41, MANISH CHATURVEDI at email@hidden wrote:
> Hi All,
>
> I am writing a sync application where I've used Interface builder to design
> the GUI.Sync runs when we click a button .I've disabled the button after first
> click of user by using [m_syncButton setEnable:NO], but this is not working
> at all.If I click on the button multiple times, all my clicks are getting
> queued and these clicks are triggering my sync again and again i.e. equal to
> number of clicks.
>
> I am disabling the button of the very first click of sync Button.This is some
> thing code looks like
>
> - (IBAction)sync:(id)sender
> {
> [m_syncButton setEnable:NO]
>
> // Code for running sync............
> [self triggerSync:syncSession];
>
> }
>
>
> The action performed by clicking thy m_sync Button is there in sync method
> where I am disabling the the button in the very first statement of sync method
> ,but still it triggers the sync two times if I double click the button.
> According to me button should get disable after first sync and should not run
> yet another sync.
>
> Is there is some thing that I am missing!!
You have the correct ideas and your code should work, but apparently you
have made some trivial mistake.
Check that you are using setEnabled: not setEnable:. Make sure that you
have not defined a setEnable: method somewhere. Make sure that m_syncButton
is the same one instantiated in Interface Builder. Try:
[sender setEnabled:NO] ;
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden