NSMutableArray를 다른 테이블 뷰에 전달하고이를 테이블 뷰에 표시하려고합니다. I과 같이 데이터를 전송할객관적인 C 테이블 뷰 컨트롤러에 NSMutabelArray를 표시
2017-02-07 18:32:24.086 krib[13753:2978659] (
"Balcony.png",
"Utilities Included.png",
"Air-conditioning.png",
"Stove.png",
"WiFi Included.png",
"Queen Bed.png",
"Dining Table.png",
"Washing Machine.png",
"Dryer.png",
"Sofa.png",
"TV.png",
"Curtains.png",
"Refrigerator.png",
"Water Heater.png",
"Microwave Oven.png"
)
,
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:@"segue"]) {
MZFormSheetPresentationViewControllerSegue *presentationSegue = (id)segue;
presentationSegue.formSheetPresentationController.presentationController.shouldApplyBackgroundBlurEffect = YES;
UINavigationController *navigationController = (id)presentationSegue.formSheetPresentationController.contentViewController;
AmennitiesTableTableViewController *presentedViewController = [navigationController.viewControllers firstObject];
// presentedViewController.textFieldBecomeFirstResponder = YES;
presentedViewController.passingString = facilities;
}
테이블 뷰 컨트롤러에서 데이터를 수신
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(close)];
NSLog(@"%@",self.passingString);
[self.tableView reloadData];
}
I는 다음과 같이 변경 가능한 배열을 도시하려
,
다음과 같이 내있는 NSMutableArray은- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellIdentifier = @"facilitiesCell";
AmenitiesTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
cell.facilitylbl.text = [self.passingString objectAtIndex:indexPath.row];
// Configure the cell...
return cell;
}
그러나 나는 tableview에서 데이터를 채우기 위해 정확히 무엇이 빠졌는지 이해하지 못하고있다.
누락 된 정보 :'self.tableView'의'delegate'과'datasource'가 설정되어 있습니까? 'tableView : numberOfRowsInSection :''self.passingString.count'에 돌아 왔습니까? – Larme
@ S.Sallay 콘솔 로그에서 오류 코드를 여기에 추가하십시오. –
[UITableViewCell facilitylbl] : 인스턴스로 전송 된 인식 할 수없는 선택기 0x7f89c9c44400 2017-02-08 09 : 44 : 48.567 krib [914 : 49152] *** 캐치되지 않은 예외 'NSInvalidArgumentException'으로 인해 앱 종료 중, 이유 : '- [UITableViewCell facilitylbl] : 인식 할 수없는 셀렉터가 인스턴스 0x7f89c9c44400으로 전송되었습니다. ' 알림, NSMutable 배열을 사용합니다. – shamila