• 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: selector not recognized problem (newbie question)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: gdb objc_msgSend: trace messages
  • Next by Date: Re: gdb objc_msgSend: trace messages
  • Previous by thread: Re: selector not recognized problem (newbie question)
  • Next by thread: Find-like list view?
  • Index(es):
    • Date
    • Thread