1

在我的应用程序中,Web 服务是在 dot net 中创建的,我正在使用这些服务,我得到了响应。在所有领域,如公司、类型、位置,一切都是字符串,这没有问题。还有一个字段称为展览编号实际上它是一个整数,但它们仅作为字符串创建。当我显示这个时,它显示的是零而不是那个数字。这是我的代码......

//Storing into Array
[SurveyFilesArray addObject:[NSDictionary dictionaryWithObjectsAndKeys:[dic objectForKey:@"FileName"],@"FileName",[dic objectForKey:@"ExibhitNumber"],@"ExhibitNumber",[dic objectForKey:@"Description"],@"Description",[dic objectForKey:@"FileQuality"],@"FileQuality",nil]];

//Retrieving from Array..
NSLog(@"???%@???",[NSString stringWithFormat:@"%d",[[[SurveyFilesArray objectAtIndex:indexPath.row]objectForKey:@"ExibhitNumber"]intValue]]);
NSLog(@"%d",[[[SurveyFilesArray objectAtIndex:indexPath.row]objectForKey:@"ExibhitNumber"]intValue]);
4

1 回答 1

1

您的代码中有拼写错误。

按照您的代码顺序:
Ex-ib-hit-Number
Ex-hib-it-Number

这是2个不同的字符串。

在您的示例代码中,您将其正确保存为Ex-hib-it. 但是您稍后尝试访问它ex-ib-hit。这行不通。

于 2012-10-25T10:32:30.113 回答