objective c - How to initialize a NSMutable array in a UIView subclass -


i create nsmutablearray , fill bunch coordinates.

i assign array property of array this:

draw.shapecoords = [shapes shapecoords]; 

where draw class , shapes class , shapecoords properties in both of them.

when drawrect method, array of coordinates empty. i'm did little research , found @synthesize not fully instantiate nsmutablearray, how in draw class (which implements uiview) initialize array? basically, need access data in array, how it?

@synthesize doesn't instantiate object @ — creates variable (initialized nil) , accessor methods. need create array. in initwithframe:, you'll want _shapecoords = [[nsmutablearray alloc] init].


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -