我有解析數據和UITableView設置問題。每次運行該應用程序時,無論是在模擬器還是手機上,應用程序都停止工作,控制檯顯示的唯一信息是(lldb)
。在檢查調試器時,只會突出顯示兩行代碼。UITableView和解析數據
findTimelineData.findObjectsInBackgroundWithBlock{
和
self.timelineData = array as NSMutableArray
雙方都有錯誤:Thread 1: EXC_BREAKPOINT (code=EXC_I386_BPT,subcode=0x0)
和IM不太清楚這是什麼意思?
這裏是我的代碼片段:
override func viewDidAppear(animated: Bool)
{
self.loadData()
}
func loadData()
{
timelineData.removeAllObjects()
var findTimelineData : PFQuery = PFUser.query()
findTimelineData.findObjectsInBackgroundWithBlock{
(objects: [AnyObject]!, error: NSError!)-> Void in
if error == nil
{
println("No error")
if let object = objects as? [PFObject!]
{
for object in objects
{
self.timelineData.addObject(object)
}
}
let array : NSArray = self.timelineData.reverseObjectEnumerator().allObjects
self.timelineData = array as NSMutableArray
self.tableView.reloadData()
}
}
}
這些將是我正在嘗試加載的單元格,但代碼從未得到這麼遠...
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
println("loading cell")
let postCell : LocationTableViewCell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as LocationTableViewCell
let post : PFObject = self.timelineData.objectAtIndex(indexPath.row) as PFObject
postCell.imageView.image = post.objectForKey("currentLocation") as? UIImage
postCell.userInfo.text = post.objectForKey("FirstLastName") as? String
// Configure the cell...
return postCell
}
的全碼:http://pastebin.com/MN7qcFhq
只是去嘗試,只有錯誤改變了..我仍然得到一個錯誤,除了這一次,錯誤是:'線程1:EXC_BREAKPOINT(代碼= EXC_ARM_BREAKPOINT,子代碼= 0xdefe)' – gguillaume 2014-11-08 16:19:16