Re: ARC Retain Cycles
Re: ARC Retain Cycles
- Subject: Re: ARC Retain Cycles
- From: Andy Lee <email@hidden>
- Date: Mon, 21 Apr 2014 10:35:37 -0400
On Apr 21, 2014, at 10:12 AM, Dave <email@hidden> wrote:
> There is a delegate handler which makes passing and calling simple delegates a doddle. This was originally non ARC.
>
> There is a property defined:
>
> @property (nonatomic,retain) id payloadObject;
>
> This is after I ARCed it, before that it didn’t specify it, e.g. it was (nonatomic). I must have made it retain when I was going through the properties. I’m not sure what the default is? I assume it must have been assign for this to work originally.
I'm not sure how your objects connect to each other, but it sounds like you had a retain cycle between an object and its delegate.
You should read up on ARC and how delegate relationships are handled to avoid retain cycles, since the delegator and the delegate typically point to each other. Basically, objects should not have strong references to their delegates, for the same reason that with the old retain/release memory management, objects should not retain their delegates.
--Andy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden