Created
April 9, 2015 15:22
-
-
Save jonathanpeppers/4ae66b3c51e690237259 to your computer and use it in GitHub Desktop.
NSObject Example
This file contains hidden or 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
Class *class = objc_getClass("NSObject"); | |
SEL alloc = sel_registerName("alloc"); | |
SEL init = sel_registerName("init"); | |
id *object = objc_msgSend(objc_msgSend(class, alloc), init); | |
//Ok, now make it rain | |
SEL makeItRain = sel_registerName("makeItRain:"); | |
objc_msgSend(object, makeItRain, "benjamins"); | |
SEL release = sel_registerName("release"); | |
objc_msgSend(object, release); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment