iOS Facebook SDK 在 iOS 4.1 和 4.2 中崩溃
Posted
技术标签:
【中文标题】iOS Facebook SDK 在 iOS 4.1 和 4.2 中崩溃【英文标题】:iOS Facebook SDK crashing in iOS 4.1 & 4.2 【发布时间】:2011-12-09 19:05:02 【问题描述】:是我还是其他人在使用 Facebook SDK 的那些 ios 版本上崩溃了。它发生在你要分享时,然后它给你一个错误的访问权限,调试器说“decodeGIFFrame”......经过一番研究我注意到 Facebook html 正在返回一个带有空引用的图像 "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
它发生在 Facebook webView 委托响应“webViewDidFinishLoad:”之后
【问题讨论】:
您可能需要显示一些代码(靠近并包括崩溃发生的位置),以及回溯。 编辑了我的帖子,希望对您有所帮助 我在 ios4 上遇到了完全相同的问题 :( 问题确实是GIF图片,看这个问题:***.com/questions/8411307/… 我会尝试他们的解决方案,看看它是否有效,谢谢您的建议 【参考方案1】:需要在 Facebook.m 中替换文本:
static NSString* kDialogBaseURL = @"https://m.facebook.com/dialog/";
与
static NSString* kDialogBaseURL = @"https://www.facebook.com/dialog/";
【讨论】:
哇,它确实有效,哈哈,但我想知道它为什么有效:P 感谢您的建议 我在关闭对话框时遇到了 EXC_BAD_ACCESS 崩溃。将 kDialogBaseURL 值更改为上面列出的值可以修复它。很奇怪,但我只是想分享一下我的经验,以防其他人遇到。以上是关于iOS Facebook SDK 在 iOS 4.1 和 4.2 中崩溃的主要内容,如果未能解决你的问题,请参考以下文章