Yes, I did include synthesize. I can't seem to change it in any way, including the color:
Code:
addButton.backgroundColor = [UIColor grayColor];
I'll remove the IBOutlet declaration now and try again ..... ok, still no luck.
- sk
Well, the next most likely thing that comes to mind is that you may not have linked the button in Interface Builder to the addButton in File's Owner. You might want to check that.
The NSLog message I have gets fired off when I click the button, thus Im assuming its wired correctly.
- sk
That's no guarantee that you can access the properties of the button. That just means that the button is properly wired to the selector for the message in question. It is crucial that in Interface Builder you connect the button in the nib to the corresponding IBoutlet name in File's Owner. Your response makes me think that this is almost certainly your problem.
If you don't know how to do this, open your nib (by double-clicking it in X-code) in Interface Builder. Now control-click on Files Owner. You should see 'addButton' listed under the outlets. Drag from the circle next to that over to the corresponding button in the nib.
I am able to create buttons, link functions to them, and it also seems i'm able to disable a button (because i forgot to enable it back and i couldnt click on it. My question refers to how, while a button is disabled, you can still click on it and the click will be queue until the button is enabled and the button click will then proceed and process the click.
how do i make sure nobody can click or queue some clicks while a button is disabled?
I am able to create buttons, link functions to them, and it also seems i'm able to disable a button (because i forgot to enable it back and i couldnt click on it. My question refers to how, while a button is disabled, you can still click on it and the click will be queue until the button is enabled and the button click will then proceed and process the click.
how do i make sure nobody can click or queue some clicks while a button is disabled?
Thanks!
A disabled button does not queue clicks. It ignores them. If you disable a button, the user clicks it 5 times, then 2 seconds later, you enable it again, it's as if the user never clicked the button at all.
If you want a system where button clicks get queued up and fire later you would have to jump through some hoops to do it.
What I would probably do is to leave the button active, but put logic in the action method to record button clicks. I'd also change the settings on the button so it doesn't highlight when clicked.
On the other hand, I don't think I'd make an app that queues button clicks and fires them later. It sounds like a poor, confusing user interface.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.