Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iphonejudy

macrumors 6502
Original poster
Sep 12, 2008
301
1
I want to convert the CGPoints to array ,

I saw some documents,but i didnt get what i want.

Can anyone please tell me?
 

BlackWolf

macrumors regular
Apr 9, 2009
244
0
take the first value of the CGPoint, convert it to an NSNumber. do the same with the second value of the CGPoint. than add both NSNumbers to an array with NSArray's arrayWithObjects or initWithObjects methods. there you go.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Use

Code:
[anArray addObject:[NSValue valueWithCGPoint:point]];
and

Code:
NSValue val = [annArray objectAtIndex:anIndex];
point = [val CGPointValue];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.