终于克服了所有错误,但我仍然无法在Parse中的University类的universityEnrolledName(列)中看到我的UITableView上的数据。
我认为这与我的查询有关
var query = PFQuery(className: "University")
query.whereKey("univeristyEnrolledName", equalTo:"UCSD")
query.findObjectsInBackgroundWithBlock {
(objects: [AnyObject]?, error: NSError?) -> Void in
if error == nil {
// The find succeeded.
NSLog("Successfully retrieved \(objects!.count) scores.")
// Do something with the found objects
if let objects = objects {
for object in objects {
println("The value of object.objectId is ( object.objectId)")
self.funlists.append("\(object.objectId)")
}
self.uiTableView.reloadData()
}
} else {
println("value of object is messed")
// Log details of the failure
// NSLog("Error: %@ %@", error!, error!.userInfo!)
}
}
现在已经坚持了几天,任何想法?
答案 0 :(得分:0)
您忘了更新行。
{{1}}
答案 1 :(得分:0)
您应该将数据数组实现到表视图
if let objects = objects {
for object in objects {
println("The value of object.objectId is ( object.objectId)")
self.funlists.append("\(object.objectId)")
}
tableView.reloadData()
}
//////////////
func numberOfSectionsInTableView(tableView: UITableView)->Int {
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int)->Int {
return self.funlists.count;
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)->UITableViewCell
{
let cell = tableView.dequeueReusableCellWithIdentifier("cell") as! UITableViewCell;
cell.textLabel?.text = self.funlists[indexPath.row];
return cell;
}}