1

Here is the complete error in debugger :

2012-11-11 17:57:34.534 Killer[13745:707] *** -[CFString copyWithZone:]: message sent to     deallocated instance 0xee57540
2012-11-11 18:01:59.231 Killer[13745:707] *** -[CFString class]: message sent to deallocated instance 0xee57540
(lldb) 

Programming with Obj C and Cocos 2d v1.0.1, here is the crashing line

player.zombieImage = [playersPicturesZombies objectAtIndex:idx];

The strange thing is that i am doing the potential crashing operation 10 times before it crashes, is this linked to a memory problem then ? Thanks a lot for your help.

7
  • Yes, that's a memory problem. Are you using ARC? If so, do you have a strong reference to zombieImage? If not, are you retaining it?
    – 0xSina
    Nov 12, 2012 at 0:47
  • Thanks a lot for your answer, i have the setting Automatic Reference Counting set to NO in my project. But as i am discovering that it exists, i am now wondering whether i should use it :) what do you mean by strong reference ? My zombieImage is a member of my instance player, the latter being also a member of my current class. So yes, this is supposed to be strong right ? :)
    – Max
    Nov 16, 2012 at 15:33
  • Would you advise using ARC ?
    – Max
    Nov 16, 2012 at 15:35
  • Here is zombieImage declaration : @property (nonatomic, copy) NSString *zombieImage;
    – Max
    Nov 16, 2012 at 15:42
  • I don't understand where and why i need to retain a NSString member, could you please explain ? Thanks a lot
    – Max
    Nov 16, 2012 at 15:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.