• 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: Adding methods to NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding methods to NSString


  • Subject: Re: Adding methods to NSString
  • From: Frank <email@hidden>
  • Date: Thu, 27 Nov 2003 13:47:57 +0100

That solves it thanks.

Regards,

Frank
On 2003, Nov 27, , at 10:59, Nick Zitzmann wrote:


On Nov 27, 2003, at 1:28 AM, Frank wrote:

Do you have any idea why adding the following method does not work (compiles but results in method not found):

@interface NSString ( StringSearch )
-(bool) containsString: (NSString *) string;
@end

@implementation NSString
-(bool) containsString: (NSString *) string
{
NSRange result;
result = [self rangeOfString: string options: NSCaseInsensitiveSearch];
return (result.location != NSNotFound);
}

Change the line:
@implementation NSString

to this:
@implementation NSString (StringSearch)

... and make sure it has a terminating @end. That ought to work.

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://seiryu.home.comcast.net/
S/MIME signature available upon request

"That's a funny thing to promise. Well, you can't never let anything happen to him [Nemo]; then, nothing would ever happen to him." - Dory, from the movie "Finding Nemo"
_______________________________________________
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.

References: 
 >Adding methods to NSString (From: Frank <email@hidden>)
 >Re: Adding methods to NSString (From: Nick Zitzmann <email@hidden>)
 >Re: Adding methods to NSString (From: Frank <email@hidden>)
 >Re: Adding methods to NSString (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: NSFileTypeAlias available?
  • Next by Date: Retrieve changed text from undo manager?
  • Previous by thread: Re: Adding methods to NSString
  • Next by thread: Re: Adding methods to NSString
  • Index(es):
    • Date
    • Thread