'objectAtIndex'에 해당되는 글 1건

  1. 2011.08.17 [IPhone Dev] CGPoint NSMutableArray (2)

You can't use NSMutableArray with CGPoint.

In other language we can just use " List<Template> ".

But in objective-c we use like this.

NSMutableArray * pointArray = [NSMutableArray array];

[pointArray addObject:[NSValue valueWithCGPoint:location]];

[pointArray addObject:[NSValue valueWithCGPoint:lastPoint]];


CGPoint retrievedPoint = [[pointArray objectAtIndex:0CGPointValue];

Turns out, we can only use NSMutableArray with a class or something that can make a instance with it.

So now you got a solution.

Have a good time~ 
Posted by ParkPill 박필