2012-06-06 71 views
5

我在iOS模拟器4.2/4.3上运行应用程序时出现以下错误。它的正常工作与iOS 5dyld:Library not loaded:/System/Library/Frameworks/Accounts.framework/Accounts

dyld: Library not loaded: /System/Library/Frameworks/Accounts.framework/Accounts 
    Referenced from: /Users/User/Library/Application Support/iPhone Simulator/4.3/Applications/FBFD053F-E816-4114-AFEB-D90A6A67259B/SampleApp.app/SampleApp 
    Reason: image not found 

我使用的AssetsLibrary和OpenCV框架在我的应用程序。 我没有得到错误的原因。

回答

3

您会收到此错误消息,因为Accounts.framework仅在iOS 5.0或更高版本中可用。所以你无法在iOS 4.2/4.3上运行它。

您还可以将Accounts.framework标记为可选项。在Xcode中,选择目标>构建阶段>与二进制库链接> Accounts.framework并将其标记为可选项。

此外请确保在iOS 4.3中跳过此代码(需要iOS 5.0或更高版本的代码)。您可以使用下面的代码来检查:

NSString *reqSysVer = @"5.0"; 
NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; 
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) { 

    //Add any code that requires iOS 5.0 
} 
+0

谢谢:),我删除了这个框架和项目成功工作。 – mahendraraut

5

更重要的是,你可以从链接二进制保留,但改变它与图书馆:从需要选购。 然后在您的代码中,在4.x设备中跳过框架方法。

相关问题