如何解决每对的第二个对象必须为nil
| 我在应用程序上工作,当我调试我的代码时,它显示以下错误。-(IBAction)addSelected:(id)sender
{
NSString* emptyStr = @\"\";
NSDictionary* traits = [NSDictionary dictionaryWithObjectsAndKeys:
self.walletName.text,@\"alias\",self.abc.text,@\"abc\",self.field.text,@\"field\",@\"name,\" @\"Type\",nil];-------at this point it is showing thread recieved signal sigabrt
在调试控制台中,给出了这个原因。
\'+ [NSDictionary dictionaryWithObjectsAndKeys:]:每对的第二个对象必须为非零。或者,您是否忘记了将参数列表终止为零?\'
*第一次抛出调用堆栈:
解决方法
@\"name,\" @\"Type\",
应该是@\"name\",@\"Type\",
,
在字符串内。
, NSDictionary* traits = [NSDictionary dictionaryWithObjectsAndKeys:
self.walletName.text,@\"alias\",self.abc.text,@\"abc\",self.field.text,@\"field\",@\"name\",nil];
问题是表格@ \“ name,\”。
, 就我而言,我正在这样做:
NSDate *today = [NSDate date];
NSTimeInterval currentTime = [today timeIntervalSince1970];
NSMutableDictionary *dictExpiryDate =
[NSMutableDictionary dictionaryWithObjectsAndKeys:currentTime,KEY_4_VALUE_OF_EXPIRY_DATE,nil];
这里的问题是currentTime,我按如下方式替换了currentTime:
[NSNumber numberWithDouble:currentTime]
这解决了我的问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。