string - UIWebView crashes loading link from HTML -


if call loadhtmlstring in uiwebview contains external link, try loadhtmlstring again crashes.

html loaded follows:

    nsurl *url = [[nsbundle mainbundle] urlforresource:@"help" withextension:@"html"];     nsstring *text = [nsstring stringwithcontentsofurl:url encoding:nsutf8stringencoding error:nil];      [[self webview] loadhtmlstring:text baseurl:nil]; 

help.html contain link such as:

example

if tap link loads page. have "home" button on navigation bar calls above code again (loadhtmlstring), crashes app.

any way "trick" uiwebview loading html string again after external link viewed?

references: uiwebview won't goback after loading html in ios

*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '*** setobjectforkey: key cannot nil'  #0  0x906b29c6 in __pthread_kill () #1  0x9ca6ff78 in pthread_kill () #2  0x0399957b in abort () #3  0x03b19f7b in abort_message () #4  0x03b17a25 in default_terminate() () #5  0x035620c1 in _objc_terminate() () #6  0x03b17a65 in safe_handler_caller(void (*)()) () #7  0x03b17acd in std::terminate() () #8  0x03b18bc2 in __cxa_throw () #9  0x03561f89 in objc_exception_throw () #10 0x03fd50de in -[__nsdictionarym setobject:forkey:] () #11 0x03d485ce in -[webhistoryprivate visitedurl:withtitle:increasevisitcount:] () #12 0x03d4a693 in -[webhistory(webinternal) _visitedurl:withtitle:method:wasfailure:increasevisitcount:] () #13 0x03d394b5 in webframeloaderclient::updateglobalhistory() () #14 0x04db0747 in webcore::historycontroller::replacestate(wtf::passrefptr<webcore::serializedscriptvalue>, wtf::string const&, wtf::string const&) () #15 0x04dad610 in webcore::history::stateobjectadded(wtf::passrefptr<webcore::serializedscriptvalue>, wtf::string const&, wtf::string const&, webcore::history::stateobjecttype, int&) () #16 0x0508041a in webcore::jshistory::replacestate(jsc::execstate*) () #17 0x0507ec49 in webcore::jshistoryprototypefunctionreplacestate(jsc::execstate*) () #18 0x0d892daf in 0x0d892daf () #19 0x08052e11 in jsc::interpreter::executecall(jsc::execstate*, jsc::jsobject*, jsc::calltype, jsc::calldata const&, jsc::jsvalue, jsc::arglist const&) () #20 0x07fabfc3 in jsc::call(jsc::execstate*, jsc::jsvalue, jsc::calltype, jsc::calldata const&, jsc::jsvalue, jsc::arglist const&) () #21 0x04f91d34 in webcore::jsmainthreadexecstate::call(jsc::execstate*, jsc::jsvalue, jsc::calltype, jsc::calldata const&, jsc::jsvalue, jsc::arglist const&) () #22 0x05064d15 in webcore::jseventlistener::handleevent(webcore::scriptexecutioncontext*, webcore::event*) () #23 0x04ce9eac in webcore::eventtarget::fireeventlisteners(webcore::event*, webcore::eventtargetdata*, wtf::vector<webcore::registeredeventlistener, 1ul>&) () #24 0x04ce9c76 in webcore::eventtarget::fireeventlisteners(webcore::event*) () #25 0x05333ce9 in webcore::node::handlelocalevents(webcore::event*) () #26 0x04cd0419 in webcore::eventdispatcher::dispatchevent(wtf::passrefptr<webcore::event>) () #27 0x04cd16da in webcore::eventdispatchmediator::dispatchevent(webcore::eventdispatcher*) const () #28 0x04ccf72e in webcore::eventdispatcher::dispatchevent(webcore::node*, wtf::passrefptr<webcore::eventdispatchmediator>) () #29 0x05333eaa in webcore::node::dispatchevent(wtf::passrefptr<webcore::event>) () #30 0x04bf85ad in webcore::document::finishedparsing() () #31 0x04e570ad in webcore::htmltreebuilder::finished() () #32 0x04dd4a9b in webcore::htmldocumentparser::preparetostopparsing() () #33 0x04c16a14 in webcore::documentwriter::end() () #34 0x04c092a3 in webcore::documentloader::finishedloading() () #35 0x052f6c22 in webcore::mainresourceloader::didfinishloading(double) () #36 0x052f5c58 in webcore::mainresourceloader::continueaftercontentpolicy(webcore::policyaction, webcore::resourceresponse const&) () #37 0x052f650e in webcore::mainresourceloader::didreceiveresponse(webcore::resourceresponse const&) () #38 0x052f4a58 in webcore::mainresourceloader::handledataloadnow(webcore::timer<webcore::mainresourceloader>*) () #39 0x052f8016 in webcore::timer<webcore::mainresourceloader>::fired() () #40 0x056e415c in webcore::threadtimers::sharedtimerfiredinternal() () #41 0x056e4036 in webcore::threadtimers::sharedtimerfired() () #42 0x05531c50 in webcore::timerfired(__cfrunlooptimer*, void*) () #43 0x03f11376 in __cfrunloop_is_calling_out_to_a_timer_callback_function__ () #44 0x03f10e06 in __cfrunloopdotimer () #45 0x03ef8a82 in __cfrunlooprun () #46 0x03ef7f44 in cfrunlooprunspecific () #47 0x03ef7e1b in cfrunloopruninmode () #48 0x05723c50 in runwebthread(void*) () #49 0x9ca6ded9 in _pthread_start () 

well seems bug on uiwebview.the uiwebview not supposed crash if teh content not there or html error occours.file bug


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -