Advertisement
elvman

Untitled

Feb 17th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Foundation/Foundation.h>
  2. #include <objc/message.h>
  3. #include <stdio.h>
  4.  
  5.  
  6. OBJC_ROOT_CLASS
  7. @interface TestClass: NSObject
  8. {
  9.     NSInteger pageNum;
  10. }
  11.  
  12. @property NSInteger pageNum;
  13.  
  14. @end
  15.  
  16. int main()
  17. {
  18.     /*Class cls = objc_getClass("TestClass");
  19.     SEL sel = sel_getUid("testMethod");
  20.    
  21.     objc_msgSend(cls, sel);*/
  22.    
  23.     TestClass* test = [TestClass alloc];
  24.    
  25.     [test setPageNum: 10];
  26.    
  27.     printf("%ld\n", (long)test.pageNum);
  28.    
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement