func loadMoreData(offset: Int, completion: (result: [ArtistJSONMapper]?) -> Void) {
var fetchedData = [ArtistJSONMapper]()
let pageNum: Int = offset/paging.limit
// Calling the json fetch to obtain data
JSONFetch.jsonTest() { (fetched, error) -> Void in
if(fetched != nil) {
fetchedData = fetched!
//self.tableView.reloadData()
} else {
println("error - \(error)")
}
}
println("Fetched data count is \(fetchedData.count)")
completion(result: fetchedData.count > 0 ? fetchedData : nil)
}
我正在使用 AlamofireObjectMapper 使用 JSONFetch.jsonTest() 方法获取数据。现在的问题是如何从我的控制器调用这个 loadMoreData ?