我正在使用UITableView
和Json
解析。UITableView永遠不會調用didSelectRowAtIndexPath
在
-(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公司等。)但是我不能選擇的任何細胞的行與我的手指輕敲。它真的感覺我喜歡攻絲文字...
任何人都知道這個問題?
問候......
CNC中
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
_userSettings = [NSUserDefaults standardUserDefaults];
static NSString *CellIdentifier [email protected]"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
你可以顯示你的代碼爲cellForRowAtIndexPath? – micantox
是您長按時突出顯示的單元格嗎? – Wain
@micantox,我編輯過。 Wain,不是。它不高的燈光... –