i´ve defined an array which contents 4 UIView objects which were already defined
NSArray *districtArray = [NSArray arrayWithObjects:view1, view2, view3, view4, nil];
now i´d like to add a subview to an UIView accessing the array via an index. i can´t figure out how i have to write that
it should be something like that
[districtArray[0] addSubview:poiObject];
could anybody give me a hint about the syntax?
thank you!
To get the n-th object in an NSArray, use
e.g.
Edit: Starting from Xcode 4.4 (2012 Jul) OP’s syntax is supported, i.e.
does work as expected. This is known as object subscripting.