iOS Facebook SDK在iOS 4.1和4.2中崩溃

3
有没有人或者是只有我在使用Facebook SDK的时候遇到了iOS版本崩溃的问题。当你要分享时,就会出现错误访问,调试器会显示“decodeGIFFrame”... 经过一番研究,我发现Facebook html返回的带null引用的图片是造成这种情况的原因,“img src="/images/icons/default_app_icon.gif" />”。但我认为图片的“null”引用并不是崩溃的根本原因,而是gif的渲染...如何修复它?
注:BT表示崩溃时的错误跟踪。
#0  0x33ff4938 in decodeGIFFrame ()
#1  0x33ff5ef8 in copyImageBlockSetGIF ()
#2  0x33fe463c in ImageProviderCopyImageBlockSetCallback ()
#3  0x31314e4c in CGImageProviderCopyImageBlockSetWithOptions ()
#4  0x31314cfc in CGImageProviderCopyImageBlockSet ()
#5  0x313149cc in img_blocks_create ()
#6  0x31312248 in img_data_lock ()
#7  0x31310fd0 in CGSImageDataLock ()
#8  0x315b7604 in ripc_AcquireImage ()
#9  0x315b3dfc in ripc_DrawImage ()
#10 0x31310cc4 in CGContextDelegateDrawImage ()
#11 0x31310ae8 in CGContextDrawImage ()
#12 0x34323a48 in WebCore::BitmapImage::checkForSolidColor ()
#13 0x343234d0 in WebCore::BitmapImage::cacheFrame ()
#14 0x343233cc in WebCore::BitmapImage::frameAtIndex ()
#15 0x343226a8 in WebCore::BitmapImage::draw ()
#16 0x34322568 in WebCore::GraphicsContext::drawImage ()
#17 0x343223e8 in WebCore::GraphicsContext::drawImage ()
#18 0x34321f28 in WebCore::RenderImage::paintIntoRect ()
#19 0x3431482c in WebCore::RenderImage::paintReplaced ()
#20 0x34314134 in WebCore::RenderReplaced::paint ()
#21 0x34313e90 in WebCore::RenderImage::paint ()
#22 0x34313e54 in WebCore::InlineBox::paint ()
#23 0x34313e54 in WebCore::InlineBox::paint ()
#24 0x34312c10 in WebCore::InlineFlowBox::paint ()
#25 0x34312790 in WebCore::RootInlineBox::paint ()
#26 0x34223964 in WebCore::RenderLineBoxList::paint ()
#27 0x34220138 in WebCore::RenderBlock::paintObject ()
#28 0x34221670 in WebCore::RenderBlock::paint ()
#29 0x34220a6c in WebCore::RenderBlock::paintFloats ()
#30 0x342201d8 in WebCore::RenderBlock::paintObject ()
#31 0x34221670 in WebCore::RenderBlock::paint ()
#32 0x342207f4 in WebCore::RenderBlock::paintChildren ()
#33 0x34220150 in WebCore::RenderBlock::paintObject ()
#34 0x34221670 in WebCore::RenderBlock::paint ()
#35 0x342207f4 in WebCore::RenderBlock::paintChildren ()
#36 0x34220150 in WebCore::RenderBlock::paintObject ()
#37 0x34221670 in WebCore::RenderBlock::paint ()
#38 0x342207f4 in WebCore::RenderBlock::paintChildren ()
#39 0x34220150 in WebCore::RenderBlock::paintObject ()
#40 0x34221670 in WebCore::RenderBlock::paint ()
#41 0x342207f4 in WebCore::RenderBlock::paintChildren ()
#42 0x34220150 in WebCore::RenderBlock::paintObject ()
#43 0x34221670 in WebCore::RenderBlock::paint ()
#44 0x3421e99c in WebCore::RenderLayer::paintLayer ()
#45 0x3421ec24 in WebCore::RenderLayer::paintLayer ()
#46 0x3421ec24 in WebCore::RenderLayer::paintLayer ()
#47 0x3421dce0 in WebCore::RenderLayer::paint ()
#48 0x3421db38 in WebCore::FrameView::paintContents ()
#49 0x30369fb8 in -[WebFrame(WebInternal) _drawRect:contentsOnly:] ()
#50 0x30369dec in -[WebHTMLView drawSingleRect:] ()
#51 0x30369d20 in -[WebHTMLView drawRect:] ()
#52 0x3421d828 in drawCallback ()
Cannot access memory at address 0x4380fffc

这是在 "webViewDidFinishLoad:" 上 Facebook webView 代理响应之后发生的。

您可能需要展示一些代码(包括崩溃发生的地方)以及回溯信息。 - Michael Dautermann
修改了我的帖子,希望有所帮助。 - Herz Rod
1
我在ios4上面也遇到了完全相同的问题 :( - Nick
1
问题确实是GIF图像,可以参考这个其他的问题:http://stackoverflow.com/questions/8411307/facebook-iphone-sdk-app-crashed-in-pre-ios-4-2-but-works-fine-in-ios-4-2 - Drealmer
我会尝试他们的解决方案,看看是否有效。谢谢提前。 - Herz Rod
1个回答

3
需要在 Facebook.m 文件中替换文本:
static NSString* kDialogBaseURL = @"https://m.facebook.com/dialog/";

使用

static NSString* kDialogBaseURL = @"https://www.facebook.com/dialog/";

哇,它居然成功了哈哈,但我想知道为什么它能够成功:P 谢谢您的帮助。 - Herz Rod
当我关闭对话框时,出现了EXC_BAD_ACCESS崩溃。将kDialogBaseURL值更改为上面列出的值即可解决问题。很奇怪,但我只是想分享我的经验,以防其他人遇到类似情况。 - Jacob

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接