Re: self.myTextField.stringValue = @"" fails
Re: self.myTextField.stringValue = @"" fails
- Subject: Re: self.myTextField.stringValue = @"" fails
- From: Corbin Dunn <email@hidden>
- Date: Tue, 08 May 2012 14:10:04 -0700
On May 8, 2012, at 1:35 PM, Antonio Nunes <email@hidden> wrote:
> On 8 May 2012, at 21:46, Andy Lee wrote:
>
>> Bizarre indeed. Out of curiosity, are you using ARC? Maybe the compiler is confusedly zeroing a non-weak pointer. I'm *really* grasping at straws, though.
>
> No ARC. No garbage collection either.
>
>> Are there any bindings on the text field? Again, I don't see why it would matter; just wondering.
>
> No bindings.
>
>>> I don't release @"" anywhere, so that is indeed very, very unlikely. Also, if I avoid the exception and assign @"" to a text field a bit later on in another piece of code, it works just fine.
>>
>> The same text field (toolbarPageNumberTextField), or a different one?
>
> Another text field. I'm seeing different behaviour though between letting the code run naturally to the empty string assignment and manually moving the PC to the line in question. I'll take another look at it after a good night's sleep...
You may have a formatter on the cell, and it is returning nil.
Also, you are mixing what you are using the text field for. In some cases you are treating it like an integer, and in others a string. I don't recommend using integerValue in your case; instead, convert that integer to a string (and vice-versa when you read the value via self.toolbarPageNumberTextField.integerValue). If you fix those things your problem will probably go away.
--corbin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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