I have a 사용자 정의 '브리타 레비예프 위터블비에프첼 "사용' 의. 각 '위터블비에프첼' 의 2 개의 버튼. 이러한 버튼을 클릭하면 이미지를 바꿀 수 있는 '이리마지비에프' 셀 내에서.
각 세포는 표시하십시오 업데이트되도록 별도로 새로운 이미지가 가능할까요? 어떤 도움이 보내주시면 감사하겠습니다.
나면 이네스파스 다음과 같은 일을 통해 셀 수 있습니다.
[self.tableView beginUpdates];
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPathOfYourCell, nil] withRowAnimation:UITableViewRowAnimationNone];
[self.tableView endUpdates];
Xcode 에서 4.6 이상:
[self.tableView beginUpdates];
[self.tableView reloadRowsAtIndexPaths:@[indexPathOfYourCell] withRowAnimation:UITableViewRowAnimationNone];
[self.tableView endUpdates];
물론 해당 애니메이션 효과를 것처럼 있는모든 설정할 수 있습니다.
난 그냥, 그렇다고 didn& 호출하십시오 했다 ',' - [브리타 레비예프 셀프로이티네스파스:] # 39 빗나갔다. 그러나 다음 날 위한 것이고, 예를 들어. '나' 의 '를 할당하지' 와 '릴리스에는 누자이 긴밀한 메모리 관리.
- (void)reloadRow0Section0 {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
NSArray *indexPaths = [[NSArray alloc] initWithObjects:indexPath, nil];
[self.tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
[indexPaths release];
}
스위프트.
func updateCell(path:Int){
let indexPath = NSIndexPath(forRow: path, inSection: 1)
tableView.beginUpdates()
tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic) //try other animations
tableView.endUpdates()
}
좋아요, 하지만 여전히 '는' 방법 '은' 레로이드로사틴데스파스 인력용 위터블비베델게이트 맛보리라
가장 간단한 외곽진입 내가 상상할 수 있다.
UITableViewCell* cell = [self.tableView cellForRowAtIndexPath:indexPath];
[self configureCell:cell forIndexPath:indexPath];
, 를 it& # 39 의 중요한 습관 등 정보기술 (it) 주 스레드할 호출하십시오 콘피게레첼 너회의 '의' 구축 작업을 스레드할 비사양 ᅴ ('/' 와 '같은 얘기를 레로이 카다타 레로이드로사틴데스파스'). 가끔 도움됐네 추가할 수 있습니다.
dispatch_async(dispatch_get_main_queue(), ^
{
[self configureCell:cell forIndexPath:indexPath];
});
BOOL cellIsVisible = [[self.tableView indexPathsForVisibleRows] indexOfObject:indexPath] != NSNotFound;
if (cellIsVisible)
{
....
}
사용자 정의 타바레비예프첼스 사용하는 경우, 일반
[self.tableView reloadData];
이 질문에 답하는 효과적으로 언약보다는 않으면 현재 보기입니다 남겨두십시오 및 돌아온다면요. 첫 번째 대답을 괜찼습니다 높여줍니까.
, 뷰 테이블 뷰 셀입니다 성공적으로 리로드하려면 처음 전환하지 않고 다음 코드를 사용합니다.
//For iOS 5 and later
- (void)reloadTopCell {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
NSArray *indexPaths = [[NSArray alloc] initWithObjects:indexPath, nil];
[self.tableView reloadRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
}
- (void)refresh:(UIRefreshControl *)refreshControl {
//call to the method which will perform the function
[self reloadTopCell];
//finish refreshing
[refreshControl endRefreshing];
}
이제 당신의 ',' 이 정렬할지 인사이드라면 비에우디드로이드 추가 다음과 같습니다.
//refresh table view
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:refreshControl];
이제 새로고치기 테이블 위에 셀입니다 리로드하려면 피쳐에는 사용자 정의 된다. 전체 표의 리로드하려면 추가
[셀프리타 레비예프 레로이 카다타] ',' 을 통해 새로운 새로고치기 메서드입니다.
원할 경우 데이터 리로드하려면 때마다 구현하십시오 보기를 전환할 수 있는 방법:
//ensure that it reloads the table view data when switching to this view
- (void) viewWillAppear:(BOOL)animated {
[self.tableView reloadData];
}
그냥 약간 새로운 iOS 의 구문을 사용하여 이러한 문제의 답을 업데이트하려면 ipv6-literal. 6 너회가 패스이므로 = @ [이네스파스] 를 사용할 수 있는 단일 객체 또는 패스이므로 = @ [indexpath1, indexpath2.] 여러 객체에 대한.
개인적으로 I& # 39, ve 막대하게 크고 보존 및 사전을 찾을 수 있는 유용한 ipv6-literal. 구문 어레이에는 시간. # 39 에 대한 한 가지 분명한 것은, 그냥 it& 쉽게 읽을 수 있습니다. 또한, 모든 다중 객체 나열하십시오 절감뿐만 필요성을 모두 개인 도깨비 말 디스크입니다. diskid 항상 있었다. 우리 모두 함께 우리의 풍차 기울기, 그렇지? -)
그냥 돌아보 I&; d # 39 를 던져 이 혼합. 희망을 줍니다.
하지만 난 로렌아줌마가 닫으십시오 셀입니다 데릭쉐퍼드와 업그레이드 방식이다. 내가 사용하는 경우
let indexPath = NSIndexPath(forRow: path, inSection: 1)
tableView.beginUpdates()
tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic) //try other animations
tableView.endUpdates()
키보드 사라집니다
이것은 브리타 레비예프 확장자의 스위프트 5:
import UIKit
extension UITableView
{
func updateRow(row: Int, section: Int = 0)
{
let indexPath = IndexPath(row: row, section: section)
self.beginUpdates()
self.reloadRows(at: [indexPath as IndexPath], with: UITableView.RowAnimation.automatic)
self.endUpdates()
}
}
전화를 통해
self.tableView.updateRow(row: 1)