从我的 JSON 提要中,我创建了一个NSMutableArray
来保存我的NDDictionary
对象。当我在 a 中显示它时,UITableView
它会因为<null>
Values 而崩溃。所以我需要知道,我如何才能"<null>"
从我的数组中删除这些对象。
这是从 JSON 返回的内容的打印输出:
Service Names: (
"Nether Edge to Woodhouse",
"Barnsley to Rotherham",
"Woodhouse to Nether Edge",
"Rotherham to Barnsley",
"Doncaster to Worksop",
"Worksop to Doncaster",
"Penistone to Barnsley Interchange",
"Barnsley Interchange to Penistone",
"<null>",
"Barnsley to Rotherham",
"Rotherham to Barnsley",
"<null>",
"Buttershaw to St Bedes RC Upper School",
"St Bedes RC Upper School to Buttershaw",
"<null>",
"Sandholme Drive to Ilkley GS",
"Ilkley GS to Sandholme Drive",
"<null>",
"Barnsley to Rotherham",
"Rotherham to Barnsley"
)
我尝试过诸如:
[serviceNames removeObject:@"<null>"];
[serviceNames removeObject:[NSNull null]];
和
[serviceNames removeObjectsIdenticalTo:@"<null>"];
[serviceNames removeObjectsIdenticalTo:[NSNull Null]];
到目前为止所有这些都失败了,所以任何人都可以告诉我一个"<null>"
从这个数组中删除对象的简单方法,因为它让我发疯!