Re: completion handlers?
Re: completion handlers?
- Subject: Re: completion handlers?
- From: Jens Alfke <email@hidden>
- Date: Sun, 6 Sep 2009 14:30:56 -0700
On Sep 6, 2009, at 2:02 PM, Todd Heberlein wrote:
OK, now a scoping rule question, in the sample code below, does
"self" refer to my object (i.e., the "self" when the block is
declared) or the NSSavePanel (i.e., the "self" when the code is
executed)?
Your object. Even though the save panel is calling that block, that
has no effect on what 'self' is (just as in a normal method call.)
Blocks keep track of the values of variables declared in the function/
method they're in, and keep those values when they're run; that's part
of what makes them so powerful.
—Jens_______________________________________________
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