I have profiled one of my apps using Allocations, and find that whenever I call a particular method my amount of “Live Bytes” increases by 300 KB. I have no idea what could be causing this.
The following line of code is the culprit:
CNTile *newTile = [self getTileAtPosition:3];
The associated method reads like this:
- (CNTile *)getTileAtPosition:(int)pos
{
CNTile *tileToReturn;
for (int x = 0; x < [row count]; x++)
{
for (int y = 0; y < [col count]; y++)
{
The code here generates four CGPoints and a CGMutablePathRef,
then uses CGPathContainsPoint to determine which CNTile to return.
}
}
return tileToReturn;
}
I should mention that my CNTile class contains only a UIView and UIImageView, as well as a few simple variables (such as ints and BOOLs).
Any help would be greatly appreciated!
How do you create
CGMutablePathRef? WithCGPathCreateMutable? If yes, make sure you useCGPathReleaseto release it: