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? On Jan 31, 11:25 am, David Duncan <david.dun...@apple.com> wrote: > On Jan 31, 2012, at 9:05 AM, R wrote: > > > never mind..... the class was getting dealloc. Still getting use to ARC > > and new ivar techniques. > > As a point of design here, without further knowledge on why your "ClassB" is > keeping a weak reference to the target mutable array (rather than a strong > one) this seems like a bad design choice. Weak references should generally be > used in order to break retain cycles (and even then you still need to think > carefully about where the weak pointer should go in such a design). > > Given the statements about your design, it seems like there are probably > better ways for you to put the whole thing together, primarily as it seems > you are trying to setup a producer-consumer pattern. > -- > David Duncan > > _______________________________________________ > > Cocoa-dev mailing list (cocoa-...@lists.apple.com) > > 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:https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev-garchive-... > > This email sent to cocoa-dev-garchive-98...@googlegroups.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com