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 protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to