Why is my object's weak delegate property nil in my unit tests?

前端 未结 4 1050
既然无缘
既然无缘 2020-12-31 07:54

I have a pretty simple setup for this unit test. I have a class that has a delegate property:

@interface MyClass : NSObject
...
@property (nonatomic, weak) i         


        
4条回答
  •  生来不讨喜
    2020-12-31 08:22

    This is a bug in the iOS runtime. The following discussion has more detail. In a nutshell, the iOS ARC runtime can't seem to handle weak references to proxies. The OSX runtime can.

    http://www.mulle-kybernetik.com/forum/viewtopic.php?f=4&t=252

    As far as I understand from the discussion a bug report has been filed with Apple. If anyone has a sensible idea for a workaround...

提交回复
热议问题