objective c - Terminating app due to uncaught exception 'NSInvalidArgumentException' 5 -
i getting error while running app: code is:
- (ibaction)yes:(id)sender { uialertview *msgbox=[[uialertview alloc]initwithtitle:@"warrning" message:nil delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; if ([_usernametextbox.text length]>0) { if ([_passwordtextfield.text length]>0) { nsmutablestring *ms=[[nsmutablestring alloc]initwithformat:url,_usernametextbox.text,_passwordtextfield]; nsurl *serviceurl=[[nsurl alloc] initwithstring:ms]; nserror *error=nil; nsdata *data=[nsdata datawithcontentsofurl:serviceurl options:nsdatareadinguncached error:&error]; nsmutabledictionary *dic=[[nsmutabledictionary alloc]init]; nsstring *jsondata=[[nsstring alloc] initwithdata:data encoding:nsutf8stringencoding]; sbjson *parsedata=[[sbjson alloc] init]; dic=[parsedata objectwithstring:jsondata error:nil]; if([dic count]>0) { nsmutablestring *st=[[nsmutablestring alloc]initwithstring:[dic objectforkey:@"loginresult:@""+"]]; //@" " withstring:@"+" if ([st isequaltostring:@"yes"]) { uialertview * alert=[[uialertview alloc] initwithtitle:@"accept" message:@"correct username" delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; } else { uialertview * alert=[[uialertview alloc] initwithtitle:@"error" message:@"invalid username , password" delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; } } } else { msgbox.message=@"please enter password..."; [msgbox show]; } } else { msgbox.message=@"please enter username..."; [msgbox show]; }
i error:
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '* -[nsconcretedata initwithcontentsofurl:options:error:]: nil url argument'
on line:
nsmutablestring *st=[[nsmutablestring alloc]initwithstring:[dic objectforkey:@"loginresult:@""+"]]; //@" " withstring:@"+" if ([st isequaltostring:@"yes"])
Comments
Post a Comment