• 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: Obtaining the number of characters in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtaining the number of characters in a string


  • Subject: Re: Obtaining the number of characters in a string
  • From: Graham Cox <email@hidden>
  • Date: Sun, 20 Jul 2008 22:20:54 +1000

You can also use a formatter (which can be set up in IB) that allows you to call setIntValue: on a text field and have it display something sensible.

Not sure if that will help or hinder, but it's there FWIW,

hth

Graham


On 20 Jul 2008, at 10:12 pm, Tim Isted wrote:

Try using

[text2 setStringValue:[NSString stringWithFormat:@"%i", [[textField1 stringValue] length]]];

Using setIntValue on a text field won't set the text field's stringValue to be a string from that int.

Tim


[text2 setIntValue:[text1 length]];


_______________________________________________

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: 
 >Obtaining the number of characters in a string (From: Phil Faber <email@hidden>)
 >Re: Obtaining the number of characters in a string (From: Tim Isted <email@hidden>)

  • Prev by Date: Re: NSDocument's isDocumentEdited
  • Next by Date: Re: Dot Syntax docs missing?
  • Previous by thread: Re: Obtaining the number of characters in a string
  • Next by thread: Re: Obtaining the number of characters in a string
  • Index(es):
    • Date
    • Thread