Re: selector not recognized problem (newbie question)
Re: selector not recognized problem (newbie question)
- Subject: Re: selector not recognized problem (newbie question)
- From: Brant Vasilieff <email@hidden>
- Date: Sat, 29 Mar 2003 13:01:37 -0800
In addition to what Jeff wrote, you could look at extending NSString
with a category rather than a subclass.
@interface NSString (Convert_additions)
- (NSString *)essai;
@end
@implementation NSString (Convert_additions)
- (NSString *)essai
{
return @"hello";
}
@end
Then your compute action could be written as.
- (IBAction)compute:(id)sender
{
NSString *inputString = [input stringValue];
[first setStringValue: [inputString essai]];
// or
// [first setStringValue: [[input stringValue] essai]];
}
Your version fails to release the inputString.
HTH,
Brant
- (IBAction)compute:(id)sender
{
convert *inputString = nil;
inputString = [[NSString alloc] initWithString:[input
stringValue]];
[inputString essai];
[first setStringValue: inputString];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.