我想在搜索条形内容后查看Parse数据库中登录用户的图像,文本和文档。你能帮我吗?目前,我想在解析时查看用户对象。我是Parse的初学者。指向正确的指针会有所帮助。谢谢是的!我正在尝试使用解析开发drop box app。很难获得表视图的用户数据。
import Foundation
import Parse
import ParseUI
class tableViewController: PFQueryTableViewController, UITableViewDataSource, UITableViewDelegate, UISearchBarDelegate {
var searchStrings:NSMutableArray = NSMutableArray()
@IBOutlet weak var mySeachbar: UISearchBar!
@IBOutlet var myTable: UITableView!
//Init the PFQueryTable tableView
override init(style: UITableViewStyle, className: String!){
super.init(style: style, className: className)
}
//required code
required init!(coder aDecoder: NSCoder!) {
super.init(coder: aDecoder)
//Inside req code. Configure the PFQueryTableView
self.parseClassName = "_User"
self.textKey = "username"
self.textKey = "activity"
self.imageKey = "images"
self.pullToRefreshEnabled = true
self.paginationEnabled = false
}
//Define the query parameters that will provide the data for the tableview queryForTable
override func queryForTable() -> PFQuery {
var query = PFQuery(className: "_User")
query.orderByAscending("username")
return query
}
//override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFTableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! PFTableViewCell!
if cell == nil {
cell = PFTableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
}
// Extract values from the PFObject to display in the table cell
if let activity = object?["activity"] as? String {
cell?.textLabel?.text = activity
}
return cell
}
}