Nil weak reference to mock object with ARC

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is OFF
Smilies are ON
Topic review
   

Expand view Topic review: Nil weak reference to mock object with ARC

Re: Nil weak reference to mock object with ARC

Post by amariottini » 23 Jul 2012, 09:50

The bug is solved in iOS SDK 6 beta 2

Re: Nil weak reference to mock object with ARC

Post by iamleeg » 03 Jul 2012, 18:05

Please could you let me know the Radar ID? I'd like to file a duplicate as I'm suffering the same problem.

Re: Nil weak reference to mock object with ARC

Post by erik » 11 Jun 2012, 17:29

A workaround that can help in certain circumstances has been added to this question on Stack Overflow. Look for Edit 2: http://stackoverflow.com/questions/9104544/how-can-i-get-ocmock-under-arc-to-stop-nilling-an-nsproxy-subclass-set-using-a-w

Let's hope that WWDC brings good news in this regard.

Re: Nil weak reference to mock object with ARC

Post by amariottini » 19 Apr 2012, 08:30

Set the property to strong is not always correct.
It is if the object is responsible for the lifecycle of the property, not when, for example, the object receives the property simply as an "helper" object or a delegate.
Strong means the object is responsible to release the property, others simply use it.
Weak means the object will use the property but is not responsible to release it.

Re: Nil weak reference to mock object with ARC

Post by taoy » 19 Apr 2012, 00:03

taoy wrote:Does anyone have a work around for this? I'm trying to mock a view controller for an iOS app, but the weak UI elements are experiencing this problem.


Hmm, I've just set the properties to (strong) in the view controller; not sure what the ramifications of this will be.

Re: Nil weak reference to mock object with ARC

Post by taoy » 18 Apr 2012, 21:56

Does anyone have a work around for this? I'm trying to mock a view controller for an iOS app, but the weak UI elements are experiencing this problem.

Re: Nil weak reference to mock object with ARC

Post by yunjia » 26 Mar 2012, 04:41

Bug filed. Hope more people will submit the issue. It is very...... wired.

Re: Nil weak reference to mock object with ARC

Post by amariottini » 25 Mar 2012, 10:53

The bug is present even on iOS 5.1 sdk.
Bug status is open.
Maybe if others submit the same bug.....

Re: Nil weak reference to mock object with ARC

Post by yunjia » 25 Mar 2012, 09:42

Hi, any progress? What is the filed bug status? And, where can I find the status of bugs which are filed by other developer? Seems apple didn't have something like JIRA...

Re: Nil weak reference to mock object with ARC

Post by amariottini » 25 Jan 2012, 16:43

I submitted the bug.
If you submit the bug too, maybe we have more possibilities.....

Top

cron