I am working on performance improvement of my ios cocos2d game. I was checking memory allocations of the app with the help of Instruments tool when I noticed one thing. There are too many CFString objects being declared and held by [NSBundle mainBundle] call. It says,
Category: CFString (immutable) Responsible Caller: [NSBundle mainBundle]
There are many places in my code where I wrote following lines
[[NSBundle mainBundle] pathForResource:@"resource-name" ofType:@"png" isDirectory:imageDirectory];
Is this CFString problem is because of above code because I am giving a hard coded string in pathForResource method? Or what can be reason of this issue? Can anyone please help? This CFString allocations is taking about 2Mb of my code so I am worried about it.
Best Regards