Re:Objective-C literals for NSDictionary, NSArray, and NSNumber
by jemeshsu on Sunday February 19, 2012 @09:36AM
(#3609423)
Nice. I wish for ability for function to return multiple values. Is it possible at all?
[ Parent
| on HN ]
Re:Objective-C literals for NSDictionary, NSArray, and NSNumber
by 0x0 on Sunday February 19, 2012 @09:41AM
(#3609432)
Probably not, but with the new dictionary literal syntax, returning a dictionary with a set of keys-values should be a breeze :)
Re:Objective-C literals for NSDictionary, NSArray, and NSNumber
by pornel on Sunday February 19, 2012 @10:25AM
(#3609519)
You can use C99 struct literals:
return (struct x){a,b};
Small structs may be passed in registers. http://stackoverflow.com/a/3355560/27009
Re:Objective-C literals for NSDictionary, NSArray, and NSNumber
by drpancake on Sunday February 19, 2012 @10:54AM
(#3609572)
IIRC passing Obj-C object pointers in C structs is disallowed or discouraged by ARC.