Allowing nil
Allowing nil
- Subject: Allowing nil
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Fri, 21 Mar 2003 09:42:28 -0500
This is probably more of a C question than a Cocoa question, but here goes.
I have written a category on NSScanner which includes a method with this
signature:
- (BOOL)scanUpToFirstString:(NSArray *)keywords
intoString:(NSString **)aString
hitString:(NSString **)theHit
The method scans up to the next keyword after the current scan location,
returns the scanned stuff by reference in aString and returns the keyword by
reference in theHit. Works perfectly fine -- unless I pass nil as the third
argument. It throws a bad access exception if I do.
NSScanner's "intoString" methods all allow nil when you don't care to keep
the scanned characters. I'd like to allow the same thing here with theHit.
How do I do it?
Jonathan
_______________________________________________
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.