我在我的应用程序中使用了Objective-C版本的Aquatic Prime。当我为CoreFoundation函数换出Objective-C类时,我可以验证许可文件一次,但是我的代码的其他部分(使用相同的代码块)的后续验证尝试失败。为什么?
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);
我正在使用Lion上的XCode 4.1,但是针对10.6 64位进行编译。