MGTwitterEngine 在 iOS5 中崩溃
虽然 MGTwitterEngine 在以前版本的 iOS 上运行良好,但当我尝试发布 twit 时,它因 EXC_BAD_ACCESS 失败:
[twitter sendUpdate:textToShare];
Objective-C 代码执行器的最后一个列表是:
[theRequest prepare];
在 SA_OAuthTwitterEngine.m 内。这是调用堆栈:
#1 0x00045a63 in -[OAMutableURLRequest URLEncodedString:] at /Users/ben/Dropbox/Dev/External Projects/Twitter-OAuth-iPhone/OAuthConsumeriPhoneLib/OAuthConsumerSrc/OAMutableURLRequest.m:287
#2 0x000445fa in -[OAMutableURLRequest prepare] at /Users/ben/Dropbox/Dev/External Projects/Twitter-OAuth-iPhone/OAuthConsumeriPhoneLib/OAuthConsumerSrc/OAMutableURLRequest.m:131
#3 0x00041778 in -[SA_OAuthTwitterEngine _sendRequestWithMethod:path:queryParameters:body:requestType:responseType:] at /Developer/WorkShop/XDictionary/trunk/Dictionary/Twitter+OAuth/SAOAuthTwitterEngine/SA_OAuthTwitterEngine.m:325
#4 0x000356b1 in -[MGTwitterEngine sendUpdate:inReplyTo:] at /Developer/WorkShop/XDictionary/trunk/Dictionary/Twitter+OAuth/MGTwitterEngine/MGTwitterEngine.m:1037
#5 0x0003546c in -[MGTwitterEngine sendUpdate:] ()
#6 0x00023ae7 in -[SocialNetworking twitterShare] ()
#7 0x00023c2b in -[SocialNetworking OAuthTwitterController:authenticatedWithUsername:] ()
#8 0x0003d0d5 in -[SA_OAuthTwitterController gotPin:] ()
#9 0x0003eabb in -[SA_OAuthTwitterController webViewDidFinishLoad:] ()
#10 0x0051736a in -[UIWebView webView:didFinishLoadForFrame:] ()
#11 0x00518956 in -[UIWebViewWebViewDelegate webView:didFinishLoadForFrame:] ()
#12 0x01ced51d in __invoking___ ()
#13 0x01ced437 in -[NSInvocation invoke] ()
#14 0x01d1849a in -[NSInvocation invokeWithTarget:] ()
#15 0x04f09aff in -[_WebSafeForwarder forwardInvocation:] ()
#16 0x01cee0c9 in ___forwarding___ ()
#17 0x01cedce2 in __forwarding_prep_0___ ()
#18 0x01ced51d in __invoking___ ()
#19 0x01ced437 in -[NSInvocation invoke] ()
#20 0x05aa9ae3 in SendMessage(NSInvocation*) ()
#21 0x05aaa115 in HandleDelegateSource(void*) ()
#22 0x01d5b97f in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#23 0x01cbeb73 in __CFRunLoopDoSources0 ()
#24 0x01cbe454 in __CFRunLoopRun ()
#25 0x01cbddb4 in CFRunLoopRunSpecific ()
#26 0x01cbdccb in CFRunLoopRunInMode ()
#27 0x02ee1879 in GSEventRunModal ()
#28 0x02ee193e in GSEventRun ()
#29 0x00360a9b in UIApplicationMain ()
#30 0x00001d3a in main ()
有什么想法吗?解决方法? 您知道另一个与 iOS 5 兼容的 Twitter 框架吗?我唯一需要做的就是发布推文(当然,首先可以登录)。
While MGTwitterEngine works well on previous versions of iOS, it failed with EXC_BAD_ACCESS at moment when I try to post twit:
[twitter sendUpdate:textToShare];
The last list of Objective-C code executer is:
[theRequest prepare];
inside SA_OAuthTwitterEngine.m. This is call stack:
#1 0x00045a63 in -[OAMutableURLRequest URLEncodedString:] at /Users/ben/Dropbox/Dev/External Projects/Twitter-OAuth-iPhone/OAuthConsumeriPhoneLib/OAuthConsumerSrc/OAMutableURLRequest.m:287
#2 0x000445fa in -[OAMutableURLRequest prepare] at /Users/ben/Dropbox/Dev/External Projects/Twitter-OAuth-iPhone/OAuthConsumeriPhoneLib/OAuthConsumerSrc/OAMutableURLRequest.m:131
#3 0x00041778 in -[SA_OAuthTwitterEngine _sendRequestWithMethod:path:queryParameters:body:requestType:responseType:] at /Developer/WorkShop/XDictionary/trunk/Dictionary/Twitter+OAuth/SAOAuthTwitterEngine/SA_OAuthTwitterEngine.m:325
#4 0x000356b1 in -[MGTwitterEngine sendUpdate:inReplyTo:] at /Developer/WorkShop/XDictionary/trunk/Dictionary/Twitter+OAuth/MGTwitterEngine/MGTwitterEngine.m:1037
#5 0x0003546c in -[MGTwitterEngine sendUpdate:] ()
#6 0x00023ae7 in -[SocialNetworking twitterShare] ()
#7 0x00023c2b in -[SocialNetworking OAuthTwitterController:authenticatedWithUsername:] ()
#8 0x0003d0d5 in -[SA_OAuthTwitterController gotPin:] ()
#9 0x0003eabb in -[SA_OAuthTwitterController webViewDidFinishLoad:] ()
#10 0x0051736a in -[UIWebView webView:didFinishLoadForFrame:] ()
#11 0x00518956 in -[UIWebViewWebViewDelegate webView:didFinishLoadForFrame:] ()
#12 0x01ced51d in __invoking___ ()
#13 0x01ced437 in -[NSInvocation invoke] ()
#14 0x01d1849a in -[NSInvocation invokeWithTarget:] ()
#15 0x04f09aff in -[_WebSafeForwarder forwardInvocation:] ()
#16 0x01cee0c9 in ___forwarding___ ()
#17 0x01cedce2 in __forwarding_prep_0___ ()
#18 0x01ced51d in __invoking___ ()
#19 0x01ced437 in -[NSInvocation invoke] ()
#20 0x05aa9ae3 in SendMessage(NSInvocation*) ()
#21 0x05aaa115 in HandleDelegateSource(void*) ()
#22 0x01d5b97f in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#23 0x01cbeb73 in __CFRunLoopDoSources0 ()
#24 0x01cbe454 in __CFRunLoopRun ()
#25 0x01cbddb4 in CFRunLoopRunSpecific ()
#26 0x01cbdccb in CFRunLoopRunInMode ()
#27 0x02ee1879 in GSEventRunModal ()
#28 0x02ee193e in GSEventRun ()
#29 0x00360a9b in UIApplicationMain ()
#30 0x00001d3a in main ()
Any ideas? Workaround?
Do you know another Twitter framework which works well with iOS 5? The only thing I need to do with it - post twits (with possible login first, of course).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如上所述修改 SA_OAuthTwitterEngine.m 函数。
您基本上必须将 oAuth url 更新为 https。 iOS5 中的某些内容阻止它从 http 重定向到 https
Modify SA_OAuthTwitterEngine.m function as described above.
You basically have to update the oAuth urls to https. Something in iOS5 prevents it from redirecting to https from http
在构建设置中添加 -all_load 标志
https://developer.apple.com /library/mac/#qa/qa2006/qa1490.html
-all_load 强制链接器从它看到的每个存档中加载所有目标文件,即使是那些没有的Objective-C 代码。 -force_load 在 Xcode 3.2 及更高版本中可用。它允许对存档加载进行更精细的控制。每个 -force_load 选项后面必须跟有一个存档路径,并且该存档中的每个目标文件都将被加载。
add -all_load flag in build setting
https://developer.apple.com/library/mac/#qa/qa2006/qa1490.html
-all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.