ios - 执行 segue 抛出错误
<p><p>我在 objective-c中实现了一些 Json 帖子,在收到信息后,我尝试推送 segue 方法,但它抛出了这个异常</p>
<blockquote>
<p>2015-06-25 00:08:33.807 BarApp -: unrecognized selector sent to instance 0x37439830</p>
<p>2015-06-25 00:08:33.809 BarApp *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-: unrecognized selector sent to instance 0x37439830'</p>
</blockquote>
<p>这是我的代码</p>
<pre><code>-(void) MakePost: (int)typePost {
NSString *mainUrl = @"http://url.com/barap/usuario.php";
NSString *post;
if(typePost == 0) {
post = ;
}else if(typePost == 1){
post = ;
}
NSString *webPostUrl = ;
webPostUrl =;
NSURL *postUrl = ;
NSData *userInfo = [ initWithContentsOfURL:postUrl];
if(userInfo){
NSMutableDictionary *userResults = ;
if (! isEqualToString:@""]) {
forKey:@"userId"];
NSLog(@"%@", [ valueForKey:@"userId"]);
</code></pre>
<p>这是我的代码崩溃的地方!</p>
<pre><code>;
if(typePost == 1){
;
;
}
}
}else {
UIAlertView* cError = [initWithTitle:@"Erro!" message:@"Tuvimos un Error intente mas tarde" delegate:self cancelButtonTitle:@"Cancelar" otherButtonTitles:@"OK", nil];
;
}
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if([ isEqualToString:@"loginSuccess"]) {
;
}
}
</code></pre></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>该消息表明在 <code>NSNull</code> 对象上调用了 <code>length</code> 方法。因为 <code>length</code> 方法很可能会在 <code>NSString</code></p> 上调用
<p>查看此链接</p>
<p> <a href="https://stackoverflow.com/questions/16607960/nsnull-length-unrecognized-selector-sent-to-json-objects" rel="noreferrer noopener nofollow">-: unrecognized selector sent to JSON objects</a> </p></p>
<p style="font-size: 20px;">关于ios - 执行 segue 抛出错误,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/31041743/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/31041743/
</a>
</p>
页:
[1]