In the code, even for finding the resource(image) we use several steps which include lot of CF starting functions and CFRef objects.
Code:
CGImageRef image;
CGDataProviderRef provider;
CFStringRef picturePath;
CFURLRef pictureURL;
picturePath = CFStringCreateWithCString (NULL, picture,kCFStringEncodingUTF8);
pictureURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), picturePath, CFSTR("png"), NULL);
CFRelease(picturePath);
Why cant we use
Code:
[[NSBundle mainBundle] pathForResource:@"Picture" ofType:@"png"];
. And then do UTF8 conversion.
Its a big doubt for me since I am new to this pdf context and all??