Question on Objective C
Steve Sisak
steve.sisak at ioxperts.com
Fri Nov 7 19:08:15 EST 2008
At 6:46 PM -0500 11/7/08, Owen Hartnett wrote:
>I think everyone subscribes to this list, but nobody uses it -- until now.
>
>I have an Objective C question and I'll try it here.
>
>It's pretty simple - I have an NSString * - I want to parse it and
>return two NSString *'s as the result of my parse.
>
>It seems I can't do something like this:
>
>- (NSString *) locationFromString:(NSString *)inputString
>locString1:(NSString *) &string1 locString2:(NSString *) &string2;
>
>
>Am I missing something? I don't see anyway to send a parameter as a
>reference - is it supported?
Obj-C is C99 (not C++), so the convention would be to use (NSString
**) -- or fill in an array of results.
Note that C99 has a lot of C++ features (inline functions, // comments, etc.)
If you're in a .mm file, you might be able to use (NSString *&), but
that's mixing metaphors a bit.
-Steve
--
_________________________________________________________________________
Steve Sisak, CTO steve.sisak at ioxperts.com
IOXperts, Inc. voice: +1 617 876-2572
87 Bristol St #3A fax: +1 617 876-2337
Cambridge, MA 02139 mobile: +1 617 388-6476
More information about the MacTechGroup-discuss
mailing list