0

我开始接触 Swift、Parse 和 IOS 的表面,我有一个关于 parse 如何执行其 findObjectsInBackgroundWithBlock 方法的问题

在下面的小片段中,有人能告诉我,如果我的应用程序会不断下载 100 个对象吗?

        query.whereKey("location", nearGeoPoint: mygeopoint, withinMiles: 20)
        query.limit = 100
        query.findObjectsInBackgroundWithBlock { (objects, error) -> Void in
            if error != nil {
                print(error)
            }else {
                for o in objects! {
                            // do some stuff                        
                }
            }
    }

作为一个后续问题:假设我想维护到目前为止看到的对象的引用,所以我不必再次下载它们,从而只获得新对象,我该怎么做?

作为后续问题的后续行动:假设原始查询中没有新对象,我想执行一个新查询,例如

query.whereKey("city", containsString: "San Francisco")

(继续阅读)反映这样的逻辑,如果我周围 20 英里内没有新对象,则向我发送与 city = San Francisco 匹配的对象:我会怎么做?

我也一直在阅读有关PromiseKit的内容- 这是否适用于这样的场景?

4

0 回答 0