Nil weak reference to mock object with ARC

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

Re: Nil weak reference to mock object with ARC

Postby amariottini » 25 Jan 2012, 16:43

I submitted the bug.
If you submit the bug too, maybe we have more possibilities.....
Andrea
amariottini
 
Posts: 9
Joined: 22 Jan 2012, 23:35

Re: Nil weak reference to mock object with ARC

Postby 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...
yunjia
 
Posts: 2
Joined: 25 Mar 2012, 09:23

Re: Nil weak reference to mock object with ARC

Postby 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.....
Andrea
amariottini
 
Posts: 9
Joined: 22 Jan 2012, 23:35

Re: Nil weak reference to mock object with ARC

Postby yunjia » 26 Mar 2012, 04:41

Bug filed. Hope more people will submit the issue. It is very...... wired.
yunjia
 
Posts: 2
Joined: 25 Mar 2012, 09:23

Re: Nil weak reference to mock object with ARC

Postby 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.
taoy
 

Re: Nil weak reference to mock object with ARC

Postby 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.
taoy
 

Re: Nil weak reference to mock object with ARC

Postby 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.
Andrea
amariottini
 
Posts: 9
Joined: 22 Jan 2012, 23:35

Re: Nil weak reference to mock object with ARC

Postby 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.
erik
 
Posts: 90
Joined: 10 Oct 2009, 15:22
Location: Hamburg, Germany

Re: Nil weak reference to mock object with ARC

Postby 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.
iamleeg
 

Re: Nil weak reference to mock object with ARC

Postby amariottini » 23 Jul 2012, 09:50

The bug is solved in iOS SDK 6 beta 2
Andrea
amariottini
 
Posts: 9
Joined: 22 Jan 2012, 23:35

Previous

Return to OCMock



cron