Re: self.myTextField.stringValue = @"" fails

2012-05-09 Thread Antonio Nunes
On 9 May 2012, at 19:55, Corbin Dunn wrote: >> , so probably that is causing the issue then. To make it possible to have an >> empty text field when there are no pages in the document I changed the >> symbol for 0: >> [self.toolbarPageNumberTextField.formatter setZeroSymbol:@""]; (I did >>

Re: self.myTextField.stringValue = @"" fails

2012-05-09 Thread Corbin Dunn
On May 8, 2012, at 8:48 PM, Antonio Nunes wrote: > On 8 May 2012, at 23:10, Corbin Dunn wrote: > >> >> On May 8, 2012, at 1:35 PM, Antonio Nunes wrote: >> >>> On 8 May 2012, at 21:46, Andy Lee wrote: >>> Bizarre indeed. Out of curiosity, are you using ARC? Maybe the compiler is c

Re: self.myTextField.stringValue = @"" fails

2012-05-09 Thread Ken Thomases
On May 9, 2012, at 10:30 AM, Roland King wrote: > On May 9, 2012, at 11:18 PM, Fritz Anderson wrote: > >> In my experience, setting a text field to the empty string will have it >> return nil when you access the string. I can't quite relate it to the code >> path you're following, but it may be

Re: self.myTextField.stringValue = @"" fails

2012-05-09 Thread Roland King
Sorry but that just doesn't make sense. The empty string and nil are just not the same thing. If you set a text field's text to the empty string, you will get an empty string, you will not get nil. The only way I can imagine this happening is if the text field is nil at the point you set the emp

Re: self.myTextField.stringValue = @"" fails

2012-05-09 Thread Fritz Anderson
In my experience, setting a text field to the empty string will have it return nil when you access the string. I can't quite relate it to the code path you're following, but it may be a clue. — F On 8 May 2012, at 10:48 PM, Antonio Nunes wrote: > Why do you recommend against using inte

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Roland King
On May 9, 2012, at 2:41 AM, Leandro Hoffman wrote: > Rather than use: self.myTextField.stringValue = @""; > > Couldn't you use: self.myTextField.setStringValue = @""; ? > > -- > Leandro Hoffman No. That's meaningless. self.myTextField.stringValue = @""; is just syntactic sugar f

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Leandro Hoffman
Rather than use: self.myTextField.stringValue = @""; Couldn't you use: self.myTextField.setStringValue = @""; ? -- Leandro Hoffman ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to th

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
On 8 May 2012, at 23:10, Corbin Dunn wrote: > > On May 8, 2012, at 1:35 PM, Antonio Nunes 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

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Corbin Dunn
On May 8, 2012, at 1:35 PM, Antonio Nunes 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

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
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 d

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Andy Lee
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. Are there any bindings on the text field? Again, I don't see why it would matter; just wondering. On May 8, 2012, at 1:13 PM, Antonio Nunes

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Ben Kennedy
On 08 May 2012, at 9:28 am, Charlie Dickman wrote: >> Catchpoint 7 (exception thrown).2012-05-08 18:09:31.742 MyApp[18775:507] >> Invalid parameter not satisfying: aString != nil > > @"" is the nil string and the compiler is smart enough to make the > substitution. Certainly not true. @"" is

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Antonio Nunes
On 8 May 2012, at 19:01, Jens Alfke wrote: > On May 8, 2012, at 9:15 AM, Antonio Nunes wrote: > >> I have a text field that when I try to set it to a literal string fails: >> This is the code: >> self.myTextField.stringValue = @""; (It also fails if the literal string is >> not empty). > > Tha

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Jens Alfke
On May 8, 2012, at 9:15 AM, Antonio Nunes wrote: > I have a text field that when I try to set it to a literal string fails: > This is the code: > self.myTextField.stringValue = @""; (It also fails if the literal string is > not empty). That is quite bizarre. So much so that I’m assuming that t

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Eeyore
There's definitely a nil being passed somewhere it shouldn't, I don't have any insights on that based on what was posted. However, I don't think @"" will be nil (at least it isn't in Xcode 4.3.2 for iOS 5.1): NSString* theString = @""; NSLog(@"%p", theString); prints 2012-05-08 09:54:20.270 i

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Jens Alfke
On May 8, 2012, at 9:28 AM, Charlie Dickman wrote: > @"" is the nil string and the compiler is smart enough to make the > substitution. Um … pardon me, but WTF? There is no such thing as a “nil string” object. @“” is a perfectly valid NSString instance with a non-nil pointer. It just happens

Re: self.myTextField.stringValue = @"" fails

2012-05-08 Thread Charlie Dickman
Read the message... Catchpoint 7 (exception thrown).2012-05-08 18:09:31.742 MyApp[18775:507] Invalid parameter not satisfying: aString != nil On May 8, 2012, at 12:15 PM, Antonio Nunes wrote: > Catchpoint 7 (exception thrown).2012-05-08 18:09:31.742 MyApp[18775:507] > Invalid parameter not sati