{"action":"created","issue":{"url":"https://api.github.com/repos/icanzilb/JSONModel/issues/480","repository_url":"https://api.github.com/repos/icanzilb/JSONModel","labels_url":"https://api.github.com/repos/icanzilb/JSONModel/issues/480/labels{/name}","comments_url":"https://api.github.com/repos/icanzilb/JSONModel/issues/480/comments","events_url":"https://api.github.com/repos/icanzilb/JSONModel/issues/480/events","html_url":"https://github.com/icanzilb/JSONModel/issues/480","id":153503878,"number":480,"title":"Can't get property value from the model collections","user":{"login":"iSingular","id":18162567,"avatar_url":"https://avatars.githubusercontent.com/u/18162567?v=3","gravatar_id":"","url":"https://api.github.com/users/iSingular","html_url":"https://github.com/iSingular","followers_url":"https://api.github.com/users/iSingular/followers","following_url":"https://api.github.com/users/iSingular/following{/other_user}","gists_url":"https://api.github.com/users/iSingular/gists{/gist_id}","starred_url":"https://api.github.com/users/iSingular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iSingular/subscriptions","organizations_url":"https://api.github.com/users/iSingular/orgs","repos_url":"https://api.github.com/users/iSingular/repos","events_url":"https://api.github.com/users/iSingular/events{/privacy}","received_events_url":"https://api.github.com/users/iSingular/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-06T17:49:19Z","updated_at":"2016-05-07T10:31:47Z","closed_at":"2016-05-06T21:45:33Z","body":"Hi there.  I have some problems when getting property value from the model collections. I try to get JsonString from GitHub API which is used for for ranking the users. here's the link:\r\n \r\nhttps://api.github.com/search/users?q=location:beijing&sort=followers&page=1\r\n\r\nhere is the code:\r\n\r\n``` objc\r\n//DataSourceModel.h\r\n\r\n@interface UserRankDataSourceModel : JSONModel\r\n@property (nonatomic, strong)NSArray<UserModel *> *items;\r\n@property (nonatomic, assign)NSInteger total_count;\r\n@end\r\n//DataSourceModel.m is clean.\r\n\r\n//UserModel.h\r\n@interface UserModel : JSONModel\r\n@property(nonatomic,strong)NSString *login;\r\n@property(nonatomic,assign)NSInteger id;\r\n@property(nonatomic,strong)NSString *avatar_url;\r\n@property(nonatomic,strong)NSString *gravatar_id;\r\n@property(nonatomic,strong)NSString *url;\r\n@property(nonatomic,strong)NSString *html_url;\r\n@property(nonatomic,strong)NSString *followers_url;\r\n@property(nonatomic,strong)NSString *following_url;\r\n@property(nonatomic,strong)NSString *gists_url;\r\n@property(nonatomic,strong)NSString *starred_url;\r\n@property(nonatomic,strong)NSString *subscriptions_url;\r\n@property(nonatomic,strong)NSString *organizations_url;\r\n@property(nonatomic,strong)NSString *repos_url;\r\n@property(nonatomic,strong)NSString *events_url;\r\n@property(nonatomic,strong)NSString *received_events_url;\r\n@property(nonatomic,strong)NSString *type;\r\n@property(nonatomic,assign) BOOL site_admin;\r\n@property(nonatomic,strong)NSString *score;\r\n\r\n//UserModel.m is clean\r\n```\r\n\r\n\r\n\r\nSo for i am able to get data using NSURLSession, and converted into UserRankDataSourceModel using the JSONModel method successfully.\r\n\r\n```\r\n//get JsonString using NSURLSession\r\n- (void)fetchDataWithCompleteHandler:(completeHandler)handler {\r\n    NSString *urlString = @\"https://api.github.com/search/users?q=location:beijing&sort=followers&page=1\";\r\n    NSURL *url = [NSURL URLWithString:urlString];\r\n    NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];\r\n    NSURLSessionDataTask *task = [session dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {\r\n        \r\n        NSError *err = nil;\r\n        NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&err];\r\n        self.dataSourceModel = [[UserRankDataSourceModel alloc] initWithDictionary:dict error:&err];\r\n        handler(self.dataSourceModel);\r\n    }];\r\n    [task resume];\r\n}\r\n```\r\n\r\nSo far so good. But when I try to render UserRankDataSourceModel into a TableView, I got some errors:\r\n\r\n```objc\r\n-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {\r\n    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@\"cell\"];\r\n    UserModel *userModel = self.dataSourceModel.items[indexPath.row];\r\n\r\n    cell.textLabel.text = userModel.login; //got error at this line\r\n/*\r\nerror message:\r\nTerminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary login]: unrecognized selector sent to instance 0x7ff318693fe0'\r\n*/\r\n    return cell;\r\n}\r\n```\r\n\r\nDoes anyone can help me or give me some hints?  thanks in advance~\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/icanzilb/JSONModel/issues/comments/217627700","html_url":"https://github.com/icanzilb/JSONModel/issues/480#issuecomment-217627700","issue_url":"https://api.github.com/repos/icanzilb/JSONModel/issues/480","id":217627700,"user":{"login":"iSingular","id":18162567,"avatar_url":"https://avatars.githubusercontent.com/u/18162567?v=3","gravatar_id":"","url":"https://api.github.com/users/iSingular","html_url":"https://github.com/iSingular","followers_url":"https://api.github.com/users/iSingular/followers","following_url":"https://api.github.com/users/iSingular/following{/other_user}","gists_url":"https://api.github.com/users/iSingular/gists{/gist_id}","starred_url":"https://api.github.com/users/iSingular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iSingular/subscriptions","organizations_url":"https://api.github.com/users/iSingular/orgs","repos_url":"https://api.github.com/users/iSingular/repos","events_url":"https://api.github.com/users/iSingular/events{/privacy}","received_events_url":"https://api.github.com/users/iSingular/received_events","type":"User","site_admin":false},"created_at":"2016-05-07T10:31:47Z","updated_at":"2016-05-07T10:31:47Z","body":"Thx! Problem fixed :)"}}