Advertisement
adilima

Calling _CFRuntimeCreateInstance

Sep 27th, 2011
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1.  
  2. #include <CoreFoundation/CoreFoundation.h>
  3.  
  4. int main (int argc, const char * argv[])
  5. {
  6.     id anObject = objc_getClass("NSWindow");
  7.     CFTypeID typeID = CFGetTypeID(anObject);
  8.     CFTypeRef pObj = _CFRuntimeCreateInstance(kCFAllocatorDefault, typeID,
  9.                                           0, NULL);
  10.     if (pObj)
  11.     {
  12.         fprintf(stdout, "SUCCEEDED\n");
  13.         CFRelease(pObj);
  14.     }
  15.     else
  16.     {
  17.         fprintf(stderr, "FAILED\n");
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement