Friday, June 1, 2012

Passing Object Pointers Between Objective C and C under ARC

Under ARC (Automatic Reference Counting), there are some things to note when passing pointers between Objective C and C codes.

When passing Objective C object pointer to C function:
    void* cptr = (__bridge void*)objcptr;

And back
    ObjCClass *objcptr = (__bridge ObjCClass*)cptr;

References

No comments:

Post a Comment