如何从PFObject数组中获取RestaurantName
的值?
我试图将objectId
中的RestaurantName
作为字符串。
var stringObjectIds: [String] = self.restaurantObjects.map { $0.objectForKey("RestaurantName", "objectId") as String }
[<FoodPhotoTest2: 0x7fa37e7ddb50, objectId: Jkl28Tcjjv, localId: (null)> {
PhotoName = "Korean Dish";
PhotoUploaded = "<PFFile: 0x7fa37e7f31d0>";
RestaurantName = "<restauranttest2: 0x7fa37e784670, objectId: JNT2dLEL79>";
UserUploaded = "<PFUser: 0x7fa37e4be170, objectId: wNJPsJDV6t>";
Votes = 0;
}]
答案 0 :(得分:0)
如果restaurantObjects
包含PFObject
s,请在地图功能中使用$0.objectId
。