如何将ID的值转换为Integer。见下文:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSMutableDictionary *curRow = [myData objectAtIndex:indexPath.row];
NSLog(@"Cell Click %@ %@ - %@",[curRow objectForKey:@"Name"], [curRow objectForKey:@"ID"], [curRow objectForKey:@"DOB"]);
UserID= [curRow [objectForKey:@"ID" intValue] ; <<<< This doesnt work?
答案 0 :(得分:2)
如果ID在字典中,则可以使用
字符串UserID = [[curRow objectForKey:@"ID"] intValue];
答案 1 :(得分:0)
你的语法错误。
UserID= [curRow [objectForKey:@"ID" intValue] ; <<<< This doesnt work?
使用以下
UserID= [[curRow objectForKey:@"ID"] intValue] ; <<<< This will work?