What is the '^' in Objective-C -
what '^' mean in code below?
@implementation appcontroller - (ibaction) loadcomposition:(id)sender { void (^handler)(nsinteger); nsopenpanel *panel = [nsopenpanel openpanel]; [panel setallowedfiletypes:[nsarray arraywithobjects: @"qtz", nil]]; handler = ^(nsinteger result) { if (result == nsfilehandlingpanelokbutton) { nsstring *filepath = [[[panel urls] objectatindex:0] path]; if (![qcview loadcompositionfromfile:filepath]) { nslog(@"could not load composition"); } } }; [panel beginsheetmodalforwindow:qcwindow completionhandler:handler]; } @end
=== i've searched , searched - sort of particular reference memory?
read on here. it's "block object", lambda form, , introduced support snow leopard's gcd (grand central dispatch).
Comments
Post a Comment