iphonejudy macrumors 6502 Original poster 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 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 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];