当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - weak property (delegate) still causing retain cycle

问题描述:

This is bizarre. I have what I think is a typical delegate property declaration:

@property (weak) id<BTSAudioStreamerDelegate> delegate;

If I assign to it from another object:

btsAudioStreamer.delegate = self;

It is retaining the delegate! I have an NSLog in dealloc and it doesn't get called. If I comment out the delegate assignment line, it does. Also the first object plays audio, and if it doesn't dealloc, I end up with two audio streams playing at the same time. Not good! How can I debug this?

EDIT: I should mention that I am setting btsAudioStreamer.delegate = nil before allocing any new objects.

分享给朋友:
您可能感兴趣的文章:
随机阅读: