• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Block Confusion...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Block Confusion... (From: R <email@hidden>)

  • Prev by Date: Re: How to deactivate an app
  • Next by Date: Re: iCloud On OSX - Cannot save changes
  • Previous by thread: Re: Block Confusion...
  • Next by thread: How to deactivate an app
  • Index(es):
    • Date
    • Thread