mapviewController에서 push segue를 사용하여 스토리 보드에 설정 한 테이블 뷰가있는 테이블 뷰 컨트롤러가 있습니다. 사용자가 통지의 방법으로 간접적으로 주석 선을 calloutAccessoryControllTapped가 호출되는 함수를 제공하는 iOS 및 그것을 만졌을 때이 제대로 작동UITableViewDelegate cellForRowAtIndexPath가 호출되지 않았습니다.
[self performSegueWithIdentifier:@"SequeToConversationList" sender:self];
했다.
그러나 제공된 콜 아웃을 XIB에 레이아웃 된 사용자 정의 콜 아웃으로 교체했습니다. 그것에는 실행중인 코드와 동일한 행이있는 액션이있는 버튼이 있습니다. 그러나 Segue가 tableView로 이동하지만 tableViewController의 cellForRowAtIndexPath는 결코 호출되지 않습니다. titleForHeaderInSection은 UITableViewDataSource 역할을한다는 것을 나타냅니다.
누구든지 아이디어가 있습니까? 코드 요청 당
:
.H :
#import <UIKit/UIKit.h>
@interface PhListTableViewController : UITableViewController <UITableViewDataSource,UITableViewDelegate>
@end
하는 .m :
#import "PhListTableViewController.h"
#import "PhSettings.h"
@interface PhListTableViewController()
@end
@implementation PhListTableViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
PhSettings *settings=[PhSettings getInstance];
settings.currentViewController = CONV_LIST;
//...
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
PhSettings *settings=[PhSettings getInstance];
return [settings.myUUIDsList count];
}
- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
return @"Active:";
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
// Configure the cell...
PhSettings *settings=[PhSettings getInstance];
NSMutableString *s = [NSMutableString string];
[s appendString:@"Alias:"];
[s appendString:[[settings.myUUIDsList objectAtIndex:indexPath.row] userAlias]];
[s appendString:@"Category: "];
[s appendString:[[settings.myUUIDsList objectAtIndex:indexPath.row] category]];
cell.textLabel.text=s;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//indexPath.row
// ...
}
@end
cellForRowAtIndexPath 때문에 하나 (또는 그 이상)라고 할 수 없습니다
XIB에서 델리게이트와 데이터 소스를 링크 시켰습니까? –
XIB는 주석 사용자 지정 설명 선에만 사용됩니다. 그것은 segue 시작과 직접 관련이 없습니다. 알림을 통해 이루어집니다. 나는. 사용자가 사용자 정의 콜 아웃의 버튼을 선택하면 일부 라운드 트립 서버 작업이 발생하고 해당 콜백이 완료되면 mapViewController에 알림이 전송되어 segue가 시작됩니다. – bhartsb
코드를 게시하여 사용자 정의 tableView를 게시 할 수 있습니까? 그래서 우리는 파고 들어갈 수 있습니다. –