You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to reload the data with updated data at runtime?
I am trying to reload the data after the tap on didselectRowAtIndexPath method
table reload fine but when I am scrolling the table than crash occurs in
below method
Can you please send a demo project with issue. So I can resolve quickly.
Sent from Yahoo Mail for iPhone
On Friday, March 16, 2018, 5:06 PM, Mohd Sazid <notifications@github.com> wrote:
How to reload the data with updated data at runtime?
I am trying to reload the data after the tap on didselectRowAtIndexPath method
table reload fine but when I am scrolling the table than crash occurs in
below method
public func cellIdentifierUsingTableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> Node{
return arrayVisibles[indexPath.row]
}
Can you please send the solution to the problem, I am stuck in solving the problem
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
It’s because I unable to reproduce the issue.
Sent from Yahoo Mail for iPhone
On Friday, March 16, 2018, 5:44 PM, Mohd Sazid <notifications@github.com> wrote:
I only want to reload the data as normally we do
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
class POIPlacesVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
// KJ Tree instances -------------------------
var arrayTree:[Parent] = []
var kjtreeInstance: KJTree = KJTree()
@IBOutlet weak var tblList: UITableView!
@IBOutlet weak var viewHeader: UIView!
@IBOutlet weak var lblHeader: UILabel!
var arrayParents: NSArray?
override func viewDidLoad() {
super.viewDidLoad()
// let filepath: String? = Bundle.main.path(forResource: "Tree", ofType: "json")
// let url = URL(fileURLWithPath: filepath ?? "")
//
// var jsonData: Data?
// do {
// jsonData = try Data(contentsOf: url)
// }catch{
// print("error")
// }
//
// var jsonDictionary: NSDictionary?
// do {
// jsonDictionary = try JSONSerialization.jsonObject(with: jsonData!, options: .init(rawValue: 0)) as? NSDictionary
// }catch{
// print("error")
// }
//
//// var arrayParents: NSArray?
// if let treeDictionary = jsonDictionary?.object(forKey: "Tree") as? NSDictionary {
// if let arrayOfParents = treeDictionary.object(forKey: "Parents") as? NSArray {
// arrayParents = arrayOfParents
// }
// }
if let arrayOfParents = arrayParents {
kjtreeInstance = KJTree(parents: arrayOfParents, childrenKey: "Children", expandableKey: "Expanded", key: "Id")
Activity
KiranJasvanee commentedon Mar 16, 2018
sazidIqabal commentedon Mar 16, 2018
I only want to reload the data as normally we do
KiranJasvanee commentedon Mar 16, 2018
sazidIqabal commentedon Mar 16, 2018
import UIKit
import KJExpandableTableTree
class POIPlacesVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
// KJ Tree instances -------------------------
var arrayTree:[Parent] = []
var kjtreeInstance: KJTree = KJTree()
// let filepath: String? = Bundle.main.path(forResource: "Tree", ofType: "json")
// let url = URL(fileURLWithPath: filepath ?? "")
//
// var jsonData: Data?
// do {
// jsonData = try Data(contentsOf: url)
// }catch{
// print("error")
// }
//
// var jsonDictionary: NSDictionary?
// do {
// jsonDictionary = try JSONSerialization.jsonObject(with: jsonData!, options: .init(rawValue: 0)) as? NSDictionary
// }catch{
// print("error")
// }
//
//// var arrayParents: NSArray?
// if let treeDictionary = jsonDictionary?.object(forKey: "Tree") as? NSDictionary {
// if let arrayOfParents = treeDictionary.object(forKey: "Parents") as? NSArray {
// arrayParents = arrayOfParents
// }
// }
// kjtreeInstance = KJTree(parents: poiDummyDat as NSArray, childrenKey: "Children", expandableKey: "Expanded", key: "Id")
}
kjtreeInstance.isInitiallyExpanded = true
kjtreeInstance.animation = .fade
// let mapVC = self.storyboard?.instantiateViewController(withIdentifier: "POIMapsVC")as! POIMapsVC
// self.navigationController?.pushViewController(mapVC, animated: true)
}
}
extension POIPlacesVC {
// let lastPoi = arrPois.lastObject as! [String : Any]// replace with current poi tupple value
let lastPoi = arrPois[Int(indexTuples[2])!]as! [String : Any]//.lastObject as! [String : Any]
let detailsPOI = lastPoi["details"]as! [String : Any]
print(lastPoi)
print(arrPois)
print(detailsPOI)
print(detailsPOI["diversion"])
print(detailsPOI["id"])
// for dict in thirdLevelData["Children"]as! NSArray {
// print(dict)
// let data = dict as! [String : Any]
//
// arrDetailsData.append(data["data"] as! [String : String])
// }
// print(arrDetailsData)
}
sazidIqabal commentedon Mar 16, 2018
I have sent the whole class and In didSelectRowAtIndexPath I need nod so I have use the same in above without expending/collapsing the cell
sazidIqabal commentedon Mar 20, 2018
Hi, Have any solution for that