• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: self.myTextField.stringValue = @"" fails
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: self.myTextField.stringValue = @"" fails
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 09 May 2012 10:55:16 -0500

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 a clue.
>
> 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 empty (or any other) string into it so you didn't really set anything at all.

Well, there was a bad claim earlier in the thread about the empty string being a "nil string object", but Fritz isn't completely off-base here.  If you bind a text field's value to a string property, the string property will typically be assigned nil whenever the text field is empty.

That's apparently not involved in the OP's situation, but he's not imagining it.

Regards,
Ken


_______________________________________________

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

References: 
 >self.myTextField.stringValue = @"" fails (From: Antonio Nunes <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Jens Alfke <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Antonio Nunes <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Andy Lee <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Antonio Nunes <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Corbin Dunn <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Antonio Nunes <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Fritz Anderson <email@hidden>)
 >Re: self.myTextField.stringValue = @"" fails (From: Roland King <email@hidden>)

  • Prev by Date: Re: saveDocument:
  • Next by Date: Re: Accessibility issues with NSPopover
  • Previous by thread: Re: self.myTextField.stringValue = @"" fails
  • Next by thread: Re: self.myTextField.stringValue = @"" fails
  • Index(es):
    • Date
    • Thread