• 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: ARC, blocks, capture variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC, blocks, capture variables


  • Subject: Re: ARC, blocks, capture variables
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 28 Sep 2015 17:47:35 -0700
  • Feedback-id: 167118m:167118agrif8a:167118sGY9JgRGVV:SMTPCORP

On Sep 28, 2015, at 17:33 , Scott Ribe <email@hidden> wrote:
>
> Ah, I just tried assignment to weak ivar then registration, gets the same value. Anyway, avoiding monkeying with temp vars to fool the compiler is why I re-did the API.

I’d say that the monkeying comes from ensuring you get the same pointer (aka arbitrary client identifier) when there’s no API contract about block literal pointer stability, AFAIK.

Yet another library API would be to have the register call return an opaque value that’s passed to the unregister call (like the block-based NSNotificationCenter observation does). That eliminates the slight jankiness (in both your old and new designs) of using pointers as meaningless identifiers.

_______________________________________________

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: 
 >ARC, blocks, capture variables (From: Scott Ribe <email@hidden>)
 >Re: ARC, blocks, capture variables (From: Quincey Morris <email@hidden>)
 >Re: ARC, blocks, capture variables (From: Scott Ribe <email@hidden>)
 >Re: ARC, blocks, capture variables (From: Scott Ribe <email@hidden>)
 >Re: ARC, blocks, capture variables (From: Quincey Morris <email@hidden>)
 >Re: ARC, blocks, capture variables (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: ARC, blocks, capture variables
  • Next by Date: Re: Drawing many different strings quickly
  • Previous by thread: Re: ARC, blocks, capture variables
  • Next by thread: NSThread subclass get blocked on 'start' method call
  • Index(es):
    • Date
    • Thread