iphonejudy macrumors 6502 Original poster Sep 12, 2008 301 1 Jun 10, 2009 #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?
I want to convert the CGPoints to array , I saw some documents,but i didnt get what i want. Can anyone please tell me?
B BlackWolf macrumors regular Apr 9, 2009 244 0 Jun 11, 2009 #2 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.
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 Jun 11, 2009 #3 Use Code: [anArray addObject:[NSValue valueWithCGPoint:point]]; and Code: NSValue val = [annArray objectAtIndex:anIndex]; point = [val CGPointValue];
Use Code: [anArray addObject:[NSValue valueWithCGPoint:point]]; and Code: NSValue val = [annArray objectAtIndex:anIndex]; point = [val CGPointValue];