Hey, I’m having a strange issue. I’m wondering if anyone can help me make sense of it. I’ve got a text field, and a date picker that can be popped up overtop of the text field at the push of a button. When the date picker shows up, I make the text field below it uneditable or selectable, and when the date picker vanishes, I make it selectable again. The problem I’m having is that even though I’m calling setSelectable:NO, the, text field still shows the selection cursor when I mouse over it (although I can’t actually select anything in it).
Here’s the kicker though, if I throw a break point into the button code and wait a second or so, then once I hit continue, the text field is properly unselectable as I would expect showing the correct cursor.
Here is my button code. Anyone have any ideas?
- (IBAction) clicked:(id)sender
{
if([datePickerView isHidden] == NO)
{
[summaryTextArea setEnabled:YES];
[summaryTextArea setEditable:YES];
[summaryTextArea setSelectable:YES];
[datePickerView setHidden:YES];
}
else
{
[summaryTextArea setEnabled:NO];
[summaryTextArea setEditable:NO];
[summaryTextArea setSelectable:NO];
[datePickerView setHidden:NO];
}
}
If anyone wants to see more of a code snippet, please let me know and I can probably work together a small demo project. Thanks!
Edit:
Here is a simple test app I whipped up. Hopefully it’s helpful. http://dl.dropbox.com/u/917639/ExampleSelectable.zip
I fixed it… sort of. It’s working at least, seems like a bit of a hack though. I simply paired the following calls in my click handler