“self” not available in debugger on iOS 5.1

后端 未结 3 576
别那么骄傲
别那么骄傲 2021-01-12 17:25

I\'m trying to debug a problem running under iOS 5.1 and when I stop in the debugger inside the code that gets the error and try to print something with the debugger I get t

3条回答
  •  甜味超标
    2021-01-12 17:59

    This is a debugger bug (Yeah, imagine that!)

    Simply restart XCode, and it shouldn't be a problem for you anymore :)

    EDIT:

    Psyche! I was thinking of something else.

    You're creating a retain cycle, and as of now, the debugger classifies this specific retain cycle this way (As I said, a bug).

    To fix this, create a weak copy of self:

    __weak __typeof(self)weakSelf = self;

    Then for the self that's giving you trouble:

    Change self.object to weakSelf.object

提交回复
热议问题