Re: ARC Retain Cycles
Re: ARC Retain Cycles
- Subject: Re: ARC Retain Cycles
- From: Dave <email@hidden>
- Date: Mon, 21 Apr 2014 11:45:47 +0100
On 20 Apr 2014, at 21:32, Quincey Morris <email@hidden> wrote:
> On Apr 20, 2014, at 13:22 , Dave <email@hidden> wrote:
>
>> This App was an iOS application and previously it handled manual memory management - mostly using autorelease. I converted it by hand (didn’t use the ARC coversion process).
>
> Ah, then ignore everything I said. :)
>
>> if ([prop1 class] == [NSDictionary class])
>> self.propDict = self.pProp1;
>
> You realize that this code is utterly wrong, yes? NSDictionary is a class cluster, and so there *are no* objects of class NSDictionary, only of subclasses, most of them private to the frameworks. And even if UIImage isn’t a class cluster, particular image objects may still be a subclass.
>
> For this situation, ‘isKindOfClass:’ seem much more likely.
>
It does use isKindOfClass, I wasn’t trying to be 100% correct on the fluff, just showing giving an example of the type of thing going in in property assignment.
I didn’t write that part it was like that and by all account it sort of worked.
I may just revert back to the non-ARC version do manual Memory Management as ARC seems very difficult to debug, especially since you can’t get at things like “retainCount” or override “retain”, “release” etc.
Cheers
Dave
_______________________________________________
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