I am using a custom UITableViewCell subclass to provide content in my tableview. The cell subclass is called ValueTableViewCell. When this specific cell is selected, a UIActionSheet is to appear.
UIActionSheet *genderSheet = [[UIActionSheet alloc] initWithTitle:@"Choose Gender"
delegate:nil
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Male",@"Female"];
[genderSheet showInView:[self view]];
[genderSheet release];
Right now, I haven't set a delegate, but I will in good time. All this works just fine, but if the cell is selected again after the action sheet disappears, the app will crash. The debugger gives me the following output:
2009-08-18 17:22:47.850 BabyBlaster[10492:20b] *** -[ValueTableViewCell copyWithZone:]: unrecognized selector sent to instance 0xf68480
2009-08-18 17:22:47.851 BabyBlaster[10492:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[ValueTableViewCell copyWithZone:]: unrecognized selector sent to instance 0xf68480'
I have not sent any copy
or copyWithZone:
messages that I am aware of. Interestingly, if I take away the code for the actionsheet, and just leave the action blank, this bug does not occur. Some something weird must be happening with that action sheet, but I cannot think of what it would be.
What could be causing this?
Edit: I solved it. I stupidly forgot to terminate the otherButtonTitles with nil
.