I have an NSMutableArray:
myButtons = [[NSArray alloc] initWithObjects:@"buttonOne", ... ,@"buttonNine",nil];
where each object is the name of a button object.
Now, I want to disable all the buttons, using a for loop.
I wrote the following:
for (id obj in myButtons)
[obj setEnabled:NO];
but am getting an Error!
Am I doing something Wrong?
The problem is that you appear to be calling
setEnabledon anNSString, not on aUIButton. Either fill your array with theUIButtonobjects, or get the buttons from their string names.