objective c - Why is the Obj-C GC clearing my reference? -


I am writing a purpose-specific program that uses the garbage collector.

I'm getting In some circumstances, the classic example of an object being "more free" is to use some of the EXC_BAD_ACCESS debugging tips, i.e. MallocScribble and AUTO_LOG_COLLECTIONS , I can see that my object is being GC below me.

He said, this is my code.

[Dictionary objectForKey: key]; NSLog (@ "Object% @ is", object); [Delete objectForKey: key];

If I remove the object from the before NSLog statement, if GC runs at the right time, then EXC_BAD_ACCESS . Later never fails.

Why is this? Section on interior pointers seems the closest documentation for this event, but it does not seem to fit at all. Try to verify that your app is actually using garbage collection instead of manual reference count if the garbage collector is actually capable, it appears that there is a bug or inadequate-document facility.


Comments