0
私はクエリ "items"オブジェクトを持っています。クラスには、_Userオブジェクトを指す「親」キーがあります。Parse.com - PFUserオブジェクトからのメールは、値があるにもかかわらずnilを取得します
クエリは成功し、 '親'オブジェクトをフェッチし、この '親'オブジェクトからいくつかのカスタムキーにアクセスできますが、電子メールはnilとして返されます。下の は削除されています。
誰もがなぜこれが起こっているのでしょうか?これはより早く働いていたし、コードを変更していない。 HerokuでParse-server ver 2.5.3を実行中です。
let query = PFQuery(className: "items")
query.includeKey("parent") // parent points to _User
do {
let results = try query.findObjects()
for result in results {
let parent = result["parent"] as! PFUser
let foundUser = User()
foundUser.user = parent // User.user is of PFUser type
//custom keys in _User
foundUser.name = parent["name"] as! String
foundUser.city = parent["city"] as! String
foundUser.geoLocation = parent["location_geopoint"] as! PFGeoPoint
foundUser.userAddress = parent["user_address"] as! String
//this is failing with nil eventhough there is value in Parse
foundUser.email = parent["email"] as! String
// also tried this. parent.objectId returns a valid value
foundUser.email = parent.email
}
} catch...
https://stackoverflow.com/questions/18429723/strange-issue-with-parse-com-with-key-not-being-included –
感謝なし、それが最初の仕事ないdidntのfetchIfNeeded – ashishn
をしようとします。私はAppDelegateでParse.enableLocalDatastore()をコメントアウトしました。私はラップトップを再起動しました。シミュレータからの内容と設定を消去します。現在、実際にそれを修正したかどうかは不明です。 – ashishn