0

I was refining my project about memory management.

I have logged all my retain count at dealloc method, and i faced it.

Is it possible?

2013-11-07 11:56:03.974 Project[2749:16403] unitId : -1
2013-11-07 11:56:04.231 Project[2749:16403] specId : -1
2013-11-07 11:56:04.566 Project[2749:16403] brickId : -1
2013-11-07 11:56:45.788 Project[2749:16403] brickRow : 0
JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
erdemgc
  • 1,701
  • 3
  • 23
  • 43
  • According to your code it is. Probably not what you want though – Jesus Ramos Nov 07 '13 at 10:06
  • 3
    [When should you use retain count?](http://whentouseretaincount.com) – David Rönnqvist Nov 07 '13 at 10:07
  • Maybe it is, maybe it isn't, but who cares, because ARC exists! But, if you want a genuine answer, the retain count is probably 2147483647 (NSIntegerMax) and you got -1 because you printed the value with %i (try printing with %u). When the retain count is NSIntegerMax it means the object is immortal. Also, http://www.whentouseretaincount.com – MCKapur Nov 07 '13 at 10:08
  • 3
    remember `retainCount` is `NSUInteger` a.k.a `unsigned long` – Bryan Chen Nov 07 '13 at 10:10

1 Answers1

3

Retain counts are unsigned. If you log the maximum unsigned long value as a signed number, it will appear as -1. Your logging is written incorrectly.

Catfish_Man
  • 41,261
  • 11
  • 67
  • 84