How to convert CFDataRef into NSData ?
I have CFDataRef and I want to convert it into NSData. I am not getting how to do this.
anyone help me..
It's toll-free bridged, so you just have to cast it.
NSData *myData = (NSData *)myCFDataRef;
As @KrisMarkel said, you just have to transfer ownership to ARC like so:
Like so to transfer ownership:
NSData* data1 = (__bridge_transfer NSData*) data;
else to use the reference without transferring ownership:
NSData* data2 = (__bridge NSData*) data;