我有这个数组,我想删除里面有@“”或什么都没有的值。我想用值和新长度保留数组。
这怎么可能?

array:{
"24_7" = 1;
"abo_ok" = "";
city = "";
"compte_ok" = "";
country = FR;
"credit_card" = "Mastercard, Visa";
"date_creation" = "2011-11-05 18:01:56";
"debut_abo" = "";
dst = "992.565700179622";
email = "";
"fin_abo" = "";
"h_saturday" = "";
"h_sunday" = "";
"h_week" = "";
handicapped = "Malades assis";
hours = "";
id = 614;
"id_driver" = 614;
"info_compl" = "";
languages = "";
"location_lat" = "48.6823";
"location_long" = "6.17818";
luggage = 0;
luxury = "";
name = "Taxi";
nbvotes = "";
passengers = 4;
query = 8;
score = 9;
"special_trip" = "A\U00e9roport, Colis";
status = 2;
"tel_1" = 0383376537;
"tel_2" = "";
vehicles = "";
votes = "";
}

最佳答案

[myMutableArray removeObject: @""];


从数组中删除所有出现的@""Docs for -removeObject here

另外,如果您确实有注释中提到的可变字典

NSArray* keysToGo = [myDictionary allKeysForObject: @""];
[myDictionary removeObjectsForKeys: keysToGo];

关于iphone - 从NSMutableArray移除为空的值,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10814614/

10-12 14:49
查看更多