为什么 Aquatic Prime 在第二次尝试时无法验证文件?
我的应用程序中运行的是 Objective-C 版本的 Aquatic Prime。当我将 Objective-C 类替换为 CoreFoundation 函数时,我可以验证许可证文件一次,但后续代码其他部分(使用同一代码块)的验证尝试会失败。为什么?
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 位进行编译。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论