How to declare good old C-Array in Objective-C inline? -


this piece of code:

nsuinteger indexarr[] = {1,2,3,4};  nsindexset *indexset = [nsindexpath indexpathwithindexes:indexarr length:4]; 

is there way declare indexarr inline, like

nsindexset *indexset = [nsindexpath indexpathwithindexes:{1,2,3,4} length:4]; 

or something? it's because i'm writing test reference paths , want save lines of code not usefull anybody...

best regards, hijolen

the problem attempt need cast compiler knows right type.

nsindexset *indexset = [nsindexpath indexpathwithindexes:(nsuinteger[]){1,2,3,4} length:4]; 

Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -