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
var dataFundArr = NSMutableArray()
var dataDictionary = [
"url":"0.25",
"color":"0xFF8F8F",
"enabled":"true",
"category":"data category",
"title":"aadsa"
]
print("data dict")
for (myKey,myValue) in dataDictionary {
print("\(myKey) \t \(myValue)")
}
dataFundArr.add(dataDictionary)
let tags = dataFundArr
cell.label.setTags(tags as! [AHTag])
}
`
but the compiler is reject it saying
Could not cast value of type 'Swift._SwiftDeferredNSDictionary<Swift.String, Swift.String>' (0x10102b518) to 'AutomaticHeightTagTableViewCell.AHTag' (0x100938468).
2018-05-09 13:55:03.900266+0700 AutomaticHeightTagTableViewCell[15205:3410518] Could not cast value of type 'Swift._SwiftDeferredNSDictionary<Swift.String, Swift.String>' (0x10102b518) to 'AutomaticHeightTagTableViewCell.AHTag' (0x100938468).
the issue is still the same, i want to use my own set of array to generate data instead of json file
The text was updated successfully, but these errors were encountered:
so i assuming i had to take out something in this function to mine, or change this piece of function to accept my array
private let dataSource = { () -> [Array] in
let URL = Bundle.main.url(forResource: "TagGroups", withExtension: "json")!
// print("url " + URL)
do {
let data = try Data(contentsOf: URL)
// print("data " + Data(data))
let object = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
// print("object " + String(object))
guard let groups = object as? [[[String : Any]]] else {
fatalError("Not in an expected form of [[[String : Any]]]")
}
print("data source")
for element in groups {
print(element)
}
return groups.map({ return $0.map({ AHTag(dictionary: $0) }) })
} catch let error as NSError {
fatalError(error.localizedDescription)
}
}()
hi, so sorry for my previous opened issue,
at the moment im using your code and try to bypass your data source from json file and do this
`
private func configureCell(_ object: AnyObject, atIndexPath indexPath: IndexPath) {
if object.isKind(of: AHTagTableViewCell.classForCoder()) == false {
abort()
}
let cell = object as! AHTagTableViewCell
`
but the compiler is reject it saying
the issue is still the same, i want to use my own set of array to generate data instead of json file
The text was updated successfully, but these errors were encountered: