Re: Block Confusion...
Re: Block Confusion...
- Subject: Re: Block Confusion...
- From: Lee Ann Rucker <email@hidden>
- Date: Tue, 31 Jan 2012 21:04:12 -0800 (PST)
On Jan 31, 2012, at 3:49 PM, R wrote:
> David,
> Class B is a parser. It is passed NSData to parse (weak reference)
> and the Array (weak reference) from Class A. The results of the Data
> parse are placed into the Array. Class A will be around for the life
> of the application. Class B will be released (set to nil) after
> completing the parse.
> I chose this approach rather than delegation.
>
> Thoughts?
I'm not seeing why you use weak references. ClassB wants to hold on to its data until it's done processing it; that seems like it should be a strong reference, regardless of how long you expect the ClassB object to live. Weak references are for avoiding retain cycles between two objects that need to refer to each other, or for cases where it's OK for an object to go away if nothing else is using it.
_______________________________________________
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