我正在使用UITableView
解析Json
。
在里面
-(void) connectionDidFinishLoading :(NSURLConnection *) connection{
self.resultTable.delegate = self;
self.resultTable.dataSource = self; }
我正在解析数据并设置UITableView's
delegate
和datasource
自我。
当我编译该程序时,我解析的数据jSON
正确无误。
主要问题是:当我尝试进入行表时,调试器永远不会出现
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
我尝试了很多东西(包括 segue 等),但我无法用手指轻敲来选择任何单元格的行。真的感觉我喜欢点击文本字段......
有人知道那个问题吗?
此致 ...
-编辑-
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
_userSettings = [NSUserDefaults standardUserDefaults];
static NSString *CellIdentifier =@"CellID";
ResultNearbyList *cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
[cell.profilePictureIndicator startAnimating];
if (cell == nil) {
cell = [[ResultNearbyList alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
cell.userProfilePicture.profileID = [userFBIDArray objectAtIndex:indexPath.row];
self.userDOBStr = [userDOB objectAtIndex:indexPath.row];
self.userGenderStr = [userGender objectAtIndex:indexPath.row];
[cell.profilePictureIndicator stopAnimating];
[_listNearbyView stopAnimating];
cell.userNickName.text = [userNickNameArray objectAtIndex:indexPath.row];
NSString *fullName = [userFullNameArray objectAtIndex:indexPath.row];
NSString* fullNameUTF8 = [NSString stringWithUTF8String:[fullName cStringUsingEncoding:NSUTF8StringEncoding]];
//NSString *fullNameUTF8 = [NSString stringWithCString:[fullName cStringUsingEncoding:NSISOLatin1StringEncoding] encoding:NSUTF8StringEncoding];
cell.userFullName.text = fullNameUTF8;
NSString *userCityCountry = [userCountryArray objectAtIndex:indexPath.row];
userCityCountry = [userCityCountry stringByAppendingString:@"/"];
userCityCountry = [userCityCountry stringByAppendingString:[userCityArray objectAtIndex:indexPath.row]];
cell.userCityCountry.text = userCityCountry;
NSString *userDestination = [userDistanceArray objectAtIndex:indexPath.row];
NSRange range = [userDestination rangeOfString:@"."];
NSString *substring = (range.location != NSNotFound) ? [userDestination substringToIndex:range.location] : nil;
substring = [substring stringByAppendingString:@" km"];
if([substring intValue] == 0)
{
substring = (range.location != NSNotFound) ? [userDestination substringFromIndex:range.location] : nil;
substring = [substring substringWithRange:NSMakeRange(0, 4)];
substring = [substring stringByAppendingString:@" m"];
}
cell.userDistance.text = substring;
return cell;
}
屏幕截图:1