开发者

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

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);
NS开发者_开发问答String *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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜