【发布时间】:2012-01-28 08:05:14
【问题描述】:
我通过 Sharekit 使用 Twitter,对于 IOS5,我使用它的类 TWTweetComposeViewControllerClass 作为,
Class TWTweetComposeViewControllerClass = NSClassFromString(@"TWTweetComposeViewController");
if (TWTweetComposeViewControllerClass != nil) {
if([TWTweetComposeViewControllerClass respondsToSelector:@selector(canSendTweet)]) {
UIViewController *twitterViewController = [[TWTweetComposeViewControllerClass alloc] init];
[twitterViewController performSelector:@selector(setInitialText:)
withObject:NSLocalizedString(@"TwitterMessage", @"")];
[self.navigationController presentModalViewController:twitterViewController animated:YES];
[twitterViewController release];
}
} else {
[SHK flushOfflineQueue];
SHKItem *item = [SHKItem text:text];
//[SHKTwitter shareItem:item];
SHKActionSheet *actionsheet = [SHKActionSheet actionSheetForItem:item];
[actionsheet showFromToolbar:self.navigationController.toolbar];
}
在模拟器 5.0 上运行良好,但在 4.3 上崩溃并出现以下错误。
dyld: Library not loaded: /System/Library/Frameworks/Twitter.framework/Twitter
Referenced from: /Users/indianic/Library/Application Support/iPhone Simulator/4.3.2/Applications/241167D0-62E0-4475-85FD-0B8253B4E456/demoFBTW.app/demoFBTW
Reason: image not found
我该如何解决这个问题。 我试图将框架的依赖项从 Required 更改为 Optional,但没有找到
【问题讨论】:
-
Twitter.framework 只支持 ios 5 不支持 ios4
-
所以我不能将
TWTweetComposeViewControllerClass用于同时使用 ios5 和 ios4 的应用程序?因为我正在为使用sharekit -
“...但没有找到”。 “没有找到”是什么意思?你的意思是在 Xcode 中找不到选项?
-
是的,我没有找到框架的依赖选项
-
我知道了。要使用
weak linking,我们需要将框架从Required改为Option,即BuildPhases->LinkBinaryWithLibraries->使其成为可选
标签: iphone ios4 twitter ios5 sharekit