これらの現象が発生する必要がある方法およびプロセスです:マップここ 完了ハンドラ? async_dispatch?
でこのデータ解析
- ダウンロード画像(画像と一致して)ダウンロード関連するデータ
- プロット私のコードはビューからロードされました:
override func viewDidLoad() { imageDownload {() ->() in print("5-----inside closure") self.queryParseandSave(callback: self.plotImages) } }
イメージd ownload機能:その後、
self.plotImages
は、地図上の画像をプロットすると、別の機能queryParseandSave(callback: self.plotImages)
を呼び出しfunc imageDownload(completed: @escaping FinishedDownload){ print("1-----Started Image download") // Query for places let query = PFQuery(className:"ViewFinderObjects") query.whereKey("ImageVerified", equalTo: true) query.whereKey("coordinates", nearGeoPoint:myGeoPoint) query.limit = 10 query.findObjectsInBackground { (objects, error) -> Void in if (error == nil) { for object in objects! { print("2-----inside object for block") let imageFromParse = object["image"] as! PFFile imageFromParse.getDataInBackground(block: {(imageData, error) -> Void in print("Searching for Image") if error == nil { let obsImage:UIImage = UIImage(data: imageData!)! self.imageToShow = obsImage self.closestImage.append(self.imageToShow!) print("There are \(self.closestImage.count) images in the image array") } }) print("3-----Completed object loop") } } print("4-----Calling completed statement") completed() } }
。
私は1つの巨大な問題を持っている:イメージは、私はasync_dispatchを研究したが、これは行うには正しいことであれば見当がつかないいる
のダウンロードが終了する前に
self.plotImahes
は常に呼ばれています。