Created
September 24, 2014 14:19
-
-
Save below/1192cb4cb613c13c3e54 to your computer and use it in GitHub Desktop.
objc_msgSend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) bar { | |
SEL selector = @selector(foo); | |
typedef void (send_type) (id, SEL); | |
send_type func = (send_type)objc_msgSend(); | |
func (self, selector); | |
} | |
foobar.m:25:22: error: used type 'send_type' (aka 'void (__strong id, SEL)') where arithmetic or pointer type is required | |
send_type func = (send_type)objc_msgSend(); | |
^ ~~~~~~~~~~~~~~ | |
1 error generated. | |
This is pretty much the code given in Session 417, page 14: | |
http://devstreaming.apple.com/videos/wwdc/2014/417xx2zsyyp8zcs/417/417_whats_new_in_llvm.pdf?dl=1 | |
send_type func = (send_type)objc_msgSend;
leave out the ()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try: