Re: Newbie: How to understand Xcode's documentation
Re: Newbie: How to understand Xcode's documentation
- Subject: Re: Newbie: How to understand Xcode's documentation
- From: Graham Cox <email@hidden>
- Date: Wed, 16 Jul 2008 11:07:25 +1000
Along with what others have said, for this specific task you would
probably want to use:
-(NSString*) substringWithRange:(NSRange) range;
instead. It's fairly rare to break down strings into individual
characters.
So with your newly learned knowledge of Objective-C, you could now
write a bit of code such as:
[newField setStringValue:[[oldField stringValue]
substringWithRange:NSMakeRange(2, 3)]];
cheers, Graham
On 16 Jul 2008, at 8:19 am, Phil Faber wrote:
For example, if I want to put a substring of a larger string (eg.
"ertyu" from "qwertyuiop") into a second field, I search the
documentation and come across a thing under NSString called
getCharacters:range. I assume this will do the job as it seems to
get characters from a string as specified by a range; I then look
at the usage information which reads:
- (void)getCharacters:(unichar *)buffer range:(NSRange)aRange
_______________________________________________
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