ios - UIWebView inside Navigation Controller crashes when typing -


i've spent few hours searching solution problem can't seem find who's experienced it, let alone solution.

in project, have main view controller pushes second view controller containing uiwebview. both view controllers embedded in navigation controller. push segue , webview both hooked using ib.

the segue happens expected , web page loads , works fine until try type. tapping on text field brings keyboard, first key press crashes app , gives error:

-[nsnull length]: unrecognized selector sent instance 0x1899068 2014-02-06 04:37:19.550 *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull length]: unrecognized selector sent instance 0x1899068' *** first throw call stack: (     0   corefoundation                      0x0174d5e4 __exceptionpreprocess + 180     1   libobjc.a.dylib                     0x014d08b6 objc_exception_throw + 44 ... 

this happens both in simulator , on device. i'm particularly confused because i'm not doing remotely complex. in view controller contains webview, have following viewdidload:

- (void)viewdidload {     [super viewdidload];      nsurl *url = [nsurl urlwithstring:@"http://www.google.com"];     nsurlrequest *request = [nsurlrequest requestwithurl:url];      [self.webview loadrequest:request]; } 

and no other code. google used example site here, happens on every site i've tried. weird thing if remove segue , present web view without parent navigation controller, works fine, seems nav controller has it. said, webview property hooked ib outlet. i've tried adding programatically, outcome same. far can tell nothing in first view controller should have effect on this; said it's storyboard segue button. can sure sending length nsnull not i'm doing directly myself, don't use length selector anywhere in code.

any appreciated.

it requested full error message follows:

-[nsnull length]: unrecognized selector sent instance 0x1899068 2014-02-06 05:18:29.607 appname[859:70b] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsnull length]: unrecognized selector sent instance 0x1899068' *** first throw call stack: (     0   corefoundation                      0x0174d5e4 __exceptionpreprocess + 180     1   libobjc.a.dylib                     0x014d08b6 objc_exception_throw + 44     2   corefoundation                      0x017ea903 -[nsobject(nsobject) doesnotrecognizeselector:] + 275     3   corefoundation                      0x0173d90b ___forwarding___ + 1019     4   corefoundation                      0x0173d4ee _cf_forwarding_prep_0 + 14     5   corefoundation                      0x016cd95c cfstringgetlength + 140     6   corefoundation                      0x016e1284 cfstringcomparewithoptionsandlocale + 52     7   foundation                          0x010db634 -[nsstring compare:options:range:locale:] + 175     8   foundation                          0x010db580 -[nsstring compare:options:range:] + 69     9   foundation                          0x010eda59 -[nsstring caseinsensitivecompare:] + 80     10  uikit                               0x00454f48 -[uiphysicalkeyboardevent _matcheskeycommand:] + 280     11  uikit                               0x00398ac9 -[uiresponder(internal) _keycommandforevent:] + 312     12  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     13  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     14  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     15  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     16  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     17  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     18  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     19  uikit                               0x00398b3b -[uiresponder(internal) _keycommandforevent:] + 426     20  uikit                               0x00252176 -[uiapplication handlekeyhidevent:] + 226     21  uikit                               0x0023a07c _uiapplicationhandleeventqueue + 2954     22  corefoundation                      0x016d683f __cfrunloop_is_calling_out_to_a_source0_perform_function__ + 15     23  corefoundation                      0x016d61cb __cfrunloopdosources0 + 235     24  corefoundation                      0x016f329e __cfrunlooprun + 910     25  corefoundation                      0x016f2ac3 cfrunlooprunspecific + 467     26  corefoundation                      0x016f28db cfrunloopruninmode + 123     27  graphicsservices                    0x036f29e2 gseventrunmodal + 192     28  graphicsservices                    0x036f2809 gseventrun + 104     29  uikit                               0x0023ed3b uiapplicationmain + 1225     30  appname                             0x00003d3d main + 141     31  libdyld.dylib                       0x01d8b70d start + 1     32  ???                                 0x00000001 0x0 + 1 ) libc++abi.dylib: terminating uncaught exception of type nsexception 

so managed fix not doing anything. fixed deleting navigation controller vcs embedded in, embedding them in nav controller. works completely. don't know if errant setting or what.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -