News for hackers. Stuff that matters.
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?
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.
Re:Objective-C literals for NSDictionary, NSArray, and NSNumber by DrJokepu on Sunday February 19, 2012 @04:53PM (#3610550)
You have to explicitly bridge them in or out of ARC and indicate the ownership rules. Sometimes, for example when you're interfacing straight C code, you have no other option.