What is the '^' in Objective-C
Posted
by Chris Paterson
on Stack Overflow
See other posts from Stack Overflow
or by Chris Paterson
Published on 2010-04-29T09:49:16Z
Indexed on
2010/04/29
9:57 UTC
Read the original article
Hit count: 225
objective-c
What does the '^' mean in the 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 and searched - is it some sort of particular reference to memory?
© Stack Overflow or respective owner