Guest User

Untitled

a guest
Jan 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. void class_printIvars(Class cl) {
  2. unsigned int ivarCount;
  3. Ivar *ivars = class_copyIvarList(cl, &ivarCount);
  4. printf("Ivars for %s: \n", class_getName(cl));
  5. for (int i = 0; i < ivarCount; i++) {
  6. Ivar ivar = ivars[i];
  7. printf("%s : %s \n",
  8. ivar_getName(ivar),
  9. ivar_getTypeEncoding(ivar));
  10. }
  11. free(ivars);
  12. }
  13.  
  14. int main(int argc, const char * argv[]) {
  15. @autoreleasepool {
  16. Class bundle = objc_getClass("NSBundle");
  17. class_printIvars(bundle);
  18. }
  19. }
Add Comment
Please, Sign In to add comment