Question on Objective C

Owen Hartnett owen at clipboardinc.com
Fri Nov 7 21:42:35 EST 2008


At 7:08 PM -0500 11/7/08, Steve Sisak wrote:
>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.
>

Thanks, Steve!

-Owen


More information about the MacTechGroup-discuss mailing list