AppDelegate中有一个被叫用户参数,串错误:EXC_BAD_ACCESS
和用户有两个参数称为用户id & DepartmentID的。
我只是想访问我的WebService使用ASIHttpRequest API,
但在此之前我发送请求,
存在误差EXC_BAD_ACCESS与此代码:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
NSString *userId = appDelegate.user.userId;
NSString *departmentId = appDelegate.user.departmentId;
NSLog(@"xxxxx:%@",userId);//this can log 29
NSLog(@"xxxxx:%@",departmentId);//this can log 17
NSString *URL = [NSString stringWithFormat:@"https://xxx.xxx.xx.xx/FMS/Pages/Service/FMService.svc/GetAnnouncement?userId=%@&departmentId=%@&pageIndex=%@&pageSize=%@",userId,departmentId,1,10]; ***//ERROR***
用户ID的价值是29并且departmentId的值是17,
然后我将代码更改为:
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://xxx.xxx.xx.xx/FMS/Pages/Service/FMService.svc/GetAnnouncement?userId=%@&departmentId=%@&pageIndex=%@&pageSize=%@",userId,departmentId,1,10]];//also the same error
也有同样的错误......
,我不知道为什么,所以请帮助我,谢谢。
...我犯了这样一个愚蠢的错误!谢谢,现在好了! – jxdwinter 2012-03-18 16:03:08