Re: Trying to delete the first char of a string?
Re: Trying to delete the first char of a string?
- Subject: Re: Trying to delete the first char of a string?
- From: Jonathan del Strother <email@hidden>
- Date: Mon, 29 Oct 2007 15:42:37 +0000
On 29 Oct 2007, at 15:25, Bob Ueland wrote:
I'm testing catching key events and deleting the first char of a
mutable string (here called mstr)
@interface MyView : NSView
{
NSMutableString *mstr;
}
@end
...
-(void) awakeFromNib
{
mstr=[NSMutableString stringWithString:@"Alabama"];
}
...
- (void)insertText:(NSString *)input
{
NSLog(@"The input is %@", input);
// Delete first char
[mstr deleteCharactersInRange: NSMakeRange (0, 1)];
NSLog(@"%@",mstr);
}
mstr is being autoreleased. Retain it.
_______________________________________________
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