Why does Aquatic Prime fail to validate file on second attempt?

198 Views Asked by At

I have the Objective-C version of Aquatic Prime working in my app. When I swap out the Objective-C class for the CoreFoundation functions, I can validate the license file once, but subsequent validation attempts in other parts of my code (using the same block of code) fails. Why?

APSetKey(key);
NSString *appSupportFolder = [(MyApp_AppDelegate *)[[NSApplication sharedApplication] delegate] applicationSupportFolder];

NSString *licFile = [appSupportFolder stringByAppendingPathComponent:@"license.myapp-license"];

CFURLRef licURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,  (CFStringRef)licFile, kCFURLPOSIXPathStyle, false);
CFDictionaryRef licenseDictionary = APCreateDictionaryForLicenseFile(licURL);
if (licenseDictionary) {
    // do something
    CFRelease(licenseDictionary);
}
CFRelease(key);
CFRelease(licURL);

I'm using XCode 4.1 on Lion but compiling against 10.6 64 bit.

0

There are 0 best solutions below