Skip to content

Instantly share code, notes, and snippets.

@slembcke
Created January 23, 2012 22:36
Show Gist options
  • Save slembcke/1665894 to your computer and use it in GitHub Desktop.
Save slembcke/1665894 to your computer and use it in GitHub Desktop.
// If 'self' is assigned to obj.delegate and I don't explicitly copy the block
// it crashes with an EXC_BAD_ACCESS in objc_msgSend() calling 'retain' on
NSArray *constructors = [NSArray arrayWithObjects:
[^(cpVect pos){
GameObject *obj = ...;
obj.delegate = self;
return obj;
} copy],
nil
];
[self makeThingFrom:cpv( 278, 351) to:cpv( 44, 370) brickConstructors:constructors];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment