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 박필
nonatomic;; 

That is the one that makes problem.

when you read and write with NSMutableArray, you should use them as a property.

How to do that?

Try the following line.

@property (nonatomic, retain) NSMutableArray *dotArray;

 
That's all.
신고
Posted by ParkPill 박필

nonatomic;; 

뭔지 기억도 안난다;;  해결책은 아래와 같다.

NSMutableArray 읽고 쓸때 NSMutableArray *array; <- 요놈을 바로 쓰지 말고 @property 로 불러써 쓰면 해결된다.

@property (nonatomic, retain) NSMutableArray *dotArray;

 
끝! 
신고
Posted by ParkPill 박필

CGPoint로는 MutableArray를 사용할 수가 없네;

왜 List를 만들어 놓지 않은 걸까;;

List<CGPoint> list;

이러면 얼마나 쉽니;;

암턴 해결 방법은 아래와 같다.

NSMutableArray * pointArray = [NSMutableArray array];

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

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

        

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

 
끝! 
신고
Posted by ParkPill 박필


티스토리 툴바