You can create a CGRect object from a string representation using CGRectFromString(string)
. This takes strings in the format {{x,y},{w, h}}
(which thankfully your strings are!)
For example:
NSArray *objectCoords = [NSArray arrayWithObjects: @"{{116,371},{85,42}}", @"{{173,43},{85,42}}", @"{{145,200},{85,42}}",
for (NSString* objectCoord in objectCoords) {
CGRect coord = CGRectFromString(objectCoord);
// Draw using your coord
}
Conversely, if you have a CGRect, you can get a string representation via NSStringFromCGRect(rect)