내 코코아 응용 프로그램에서 WebView를 사용하여 URL을로드하고 있습니다. 내 요구 사항에 따라 10 분마다 URL을 다시로드합니다. 그러나 때로는 다시로드하려고 할 때 앱이 충돌했습니다. webview에서 URL을로드하기 위해 아래 코드를 사용하고 있습니다.
sample.h
#import <WebKit/WebKit.h>
@property(nonatomic,retain) IBOutlet WebView *webview;
Sample.m
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"www.dummyurl.com"]];
[self->webview.mainFrame loadRequest:request];
StackTrace :
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00007fff56efeff8
VM Regions Near 0x7fff56efeff8:
MALLOC_TINY 00007f9e7b000000-00007f9e7b100000 [ 1024K] rw-/rwx SM=ZER
--> STACK GUARD 00007fff536ff000-00007fff56eff000 [ 56.0M] ---/rwx SM=NUL stack guard for thread 0
Stack 00007fff56eff000-00007fff576ff000 [ 8192K] rw-/rwx SM=COW thread 0
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.WebCore 0x00007fff90238264 WebCore::RenderObject::containingBlock() const + 4
1 com.apple.WebCore 0x00007fff9036cdaf WebCore::RenderBlock::computeBlockPreferredLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 63
2 com.apple.WebCore 0x00007fff90d0524a WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 58
3 com.apple.WebCore 0x00007fff9047eaab WebCore::RenderBox::computeIntrinsicLogicalWidthUsing(WebCore::Length, WebCore::LayoutUnit, WebCore::LayoutUnit) const + 187
4 com.apple.WebCore 0x00007fff9033f8f4 WebCore::RenderBox::computeReplacedLogicalWidthUsing(WebCore::Length) const + 212
5 com.apple.WebCore 0x00007fff9033f707 WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(WebCore::LayoutUnit, WebCore::ShouldComputePreferred) const + 215
6 com.apple.WebCore 0x00007fff9033f572 WebCore::RenderReplaced::computeReplacedLogicalWidth(WebCore::ShouldComputePreferred) const + 1074
7 com.apple.WebCore 0x00007fff9033fcfb WebCore::RenderReplaced::computePreferredLogicalWidths() + 139
8 com.apple.WebCore 0x00007fff902c4d0b WebCore::RenderBox::minPreferredLogicalWidth() const + 27
9 com.apple.WebCore 0x00007fff90320611 WebCore::RenderBlock::computeInlinePreferredLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 3105
10 com.apple.WebCore 0x00007fff90d0523a WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 42
11 com.apple.WebCore 0x00007fff9031f6a4 WebCore::RenderBlock::computePreferredLogicalWidths() + 356
12 com.apple.WebCore 0x00007fff902c4d0b WebCore::RenderBox::minPreferredLogicalWidth() const + 27
13 com.apple.WebCore 0x00007fff90320611 WebCore::RenderBlock::computeInlinePreferredLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 3105
14 com.apple.WebCore 0x00007fff90d0523a WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 42
15 com.apple.WebCore 0x00007fff9031f6a4 WebCore::RenderBlock::computePreferredLogicalWidths() + 356
16 com.apple.WebCore 0x00007fff902c4d0b WebCore::RenderBox::minPreferredLogicalWidth() const + 27
17 com.apple.WebCore 0x00007fff90320611 WebCore::RenderBlock::computeInlinePreferredLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 3105
18 com.apple.WebCore 0x00007fff90d0523a WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 42
19 com.apple.WebCore 0x00007fff9031f6a4 WebCore::RenderBlock::computePreferredLogicalWidths() + 356
20 com.apple.WebCore 0x00007fff902c4d0b WebCore::RenderBox::minPreferredLogicalWidth() const + 27
21 com.apple.WebCore 0x00007fff9036d07c WebCore::RenderBlock::computeBlockPreferredLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 780
22 com.apple.WebCore 0x00007fff90d0524a WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) const + 58
23 com.apple.WebCore 0x00007fff9047eaab WebCore::RenderBox::computeIntrinsicLogicalWidthUsing(WebCore::Length, WebCore::LayoutUnit, WebCore::LayoutUnit) const + 187
24 com.apple.WebCore 0x00007fff9033f8f4 WebCore::RenderBox::computeReplacedLogicalWidthUsing(WebCore::Length) const + 212
25 com.apple.WebCore 0x00007fff9033f707 WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(WebCore::LayoutUnit, WebCore::ShouldComputePreferred) const + 215
26 com.apple.WebCore 0x00007fff9033f572 WebCore::RenderReplaced::computeReplacedLogicalWidth(WebCore::ShouldComputePreferred) const + 1074
27 com.apple.WebCore 0x00007fff9033fcfb WebCore::RenderReplaced::computePreferredLogicalWidths() + 139
28 com.apple.WebCore 0x00007fff902c4d0b WebCore::RenderBox::minPreferredLogicalWidth() const + 27
29 com.apple.WebCore 0x00007fff90320611 WebCore::RenderBlock::computeInlinePreferredLogicalWidths(WebCore::LayoutUnit&, WebCore::LayoutUnit&) + 3105
누구든지이 문제를 해결하기위한 솔루션을 제공하십시오.
추신 : 내 프로젝트에서 ARC를 사용하고 있습니다.
코드의 정확한 문제를 찾기 위해 예외 중단 점을 설정하는 것이 좋지만 문제가 Released 개체이기를 바랍니다. UIWebView 또는 Url이 nil이 될 것이라고 생각합니다. 당신의 물건에 강한 속성을 사용하십시오. 코드를 조금 보여줄 수 있습니까? 사용자 정의 웹보기 또는 사용자 정의 웹킷을 사용합니까?
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다