无法将数据分配给 nsmutableDictionary 或 nsdictionary
在下面的代码中,我只是分配从 api 调用返回的字符串值。将字符串值分配到 .h 文件中已声明的第 3 行的 loginResultArray
中。之后,当我将该数组移动到第四行的字典中时,字典值不会被存储。当我移动时,值没有存储在字典中。有人可以回答我吗?
NSDictionary *resultDict=[[NSDictionary alloc]init];
SBJSON *parser = [[SBJSON alloc] init];
loginResultArray=(NSMutableArray*)[parser objectWithString:jsonValue];
NSMutableDictionary *dict=(NSMutableDictionary *)[loginResultArray objectAtIndex:0];
In the code below I just assign string value that has been return form the api call. Assign the string value into the loginResultArray
in the 3rd line which has been declared in the .h file. After that when I move that array into dictionary in the 4th line the dictionary value not stored. When I moved the values are not stored in the dictionary. Can any one please answer me?
NSDictionary *resultDict=[[NSDictionary alloc]init];
SBJSON *parser = [[SBJSON alloc] init];
loginResultArray=(NSMutableArray*)[parser objectWithString:jsonValue];
NSMutableDictionary *dict=(NSMutableDictionary *)[loginResultArray objectAtIndex:0];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
保留loginResultArray的属性,综合它,然后执行以下操作:
Make the property of loginResultArray retain, synthesize it and then do the following: