Skip to content

Instantly share code, notes, and snippets.

@florianbachmann
Forked from jspahrsummers/gist:5780224
Created June 14, 2013 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florianbachmann/5781548 to your computer and use it in GitHub Desktop.
Save florianbachmann/5781548 to your computer and use it in GitHub Desktop.
#define $(...) \
({ \
__weak __typeof__(self) weakSelf = self; \
\
^(__VA_ARGS__) { \
__strong __typeof__(weakSelf) self = weakSelf; \
$_body_
#define $_body_(...) \
__VA_ARGS__ \
}; \
})
$(id arg1, unsigned arg2)({
[self doSomething:arg1 withInterestingValue:arg2];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment