[Solved] While decoding json from webservice, it shows an error: Could not cast value of type ‘__NSArrayM’ (0x10b84bdb0) to ‘NSDictionary’ (0x10b84c288)

Try this var desriptionArray = [String]() for dataValues in responseObject[“result”] as! [[String: AnyObject]] { let name = dataValues [“description”] as! String desriptionArray .append(name) } OR for (index , element) in (responseObject[“result”] as! [Any]).enumerated() { let nameDict = element as! [String : AnyObject] let strDecription = nameDict[“description”] as! String desriptionArray .insert(strDecription, at: index) } solved While … Read more

[Solved] Deleting the keys and values in NSDictionaries more than the value 100.000 kilometers

You can filter the dd as below: NSSet *keys = [dd keysOfEntriesPassingTest:^BOOL(NSString *key, NSNumber *obj, BOOL *stop) { return obj.floatValue < 10000; }]; NSLog(@”%@”, keys); [keys enumerateObjectsUsingBlock:^(NSString *key, BOOL *stop) { NSLog(@”%@”, dd[key]); }]; 2 solved Deleting the keys and values in NSDictionaries more than the value 100.000 kilometers

[Solved] I want to get particular key wise value without For Loop use [closed]

You can get it as : NSString *string=yourDict[@”WIDTH”]; Or, NSString *string=[yourDict objectForKey:@”WIDTH”]; Check NSDictionary Documentation and new Objective-C literals And please please please Start learning Objective-C, may be from Apple Documentation. Edit: As you changed your question and added “Setting:”. Now you need to use : NSString *string=yourDict[@”Setting”][@”WIDTH”]; EDIT 1: I think you have array … Read more

[Solved] how to make Dyanamic NSDictonary in Swift

You can use swift Dictionary [String: AnyObject] this way instead of NSMutableDictionary. var data = [[String: AnuObject]]() for i in 0..<questionArr.count { data.append([“QuestionID”: questionArr[i], “AnswerID”: answerArr[i]]) } let dic = [ “QuizId” : “23566656”, “StartTime” : “23:30”, “EndTime” : “23:45”, “data” : data ] print(dic) 20 solved how to make Dyanamic NSDictonary in Swift

[Solved] Populating a UITable with NSDictionary in SWIFT

Here’s what you’ll need to do: First, create a class variable for your data. Put this under your class declaration: var dataDict: [String:AnyObject]? Then, to keep things organized, put your tableView property and your userDetails property directly under the dataDict. @IBOutlet var tableView: UITableView! let userDetails: [String] = UserDefaults.standard.stringArray(forKey:”UserDetailsArray”) Now, your viewDidLoad method should look … Read more