Ios 我的桌面视图';s单元格不显示

Ios 我的桌面视图';s单元格不显示,ios,objective-c,uitableview,Ios,Objective C,Uitableview,FirstPage.h #import <UIKit/UIKit.h> #import "StudentPage.h" @interface FirstPage : UIViewController <UITableViewDelegate,UITableViewDataSource,StudentInfoDelegates> @property (strong, nonatomic) IBOutlet UITableView *tableView; - (IBActi

FirstPage.h

#import <UIKit/UIKit.h>
#import "StudentPage.h"

@interface FirstPage : UIViewController <UITableViewDelegate,UITableViewDataSource,StudentInfoDelegates>
@property (strong, nonatomic) IBOutlet UITableView *tableView;
- (IBAction)addButtonAction:(id)sender;

@end
#import <UIKit/UIKit.h>

@protocol StudentInfoDelegates
-(void)didFinishSave:(NSMutableArray*)in_studentList;
@end

@interface StudentPage : UIViewController<UITextFieldDelegate>
@property(assign,nonatomic)id<StudentInfoDelegates> delegates;

@property (strong, nonatomic) IBOutlet UITextField *name;
@property (strong, nonatomic) IBOutlet UITextField *regno;
@property (strong, nonatomic) IBOutlet UITextField *marks;    
@property (strong, nonatomic) IBOutlet UITextField *rank;

- (IBAction)save:(UIButton *)sender;
@end
StudentPage.h

#import <UIKit/UIKit.h>
#import "StudentPage.h"

@interface FirstPage : UIViewController <UITableViewDelegate,UITableViewDataSource,StudentInfoDelegates>
@property (strong, nonatomic) IBOutlet UITableView *tableView;
- (IBAction)addButtonAction:(id)sender;

@end
#import <UIKit/UIKit.h>

@protocol StudentInfoDelegates
-(void)didFinishSave:(NSMutableArray*)in_studentList;
@end

@interface StudentPage : UIViewController<UITextFieldDelegate>
@property(assign,nonatomic)id<StudentInfoDelegates> delegates;

@property (strong, nonatomic) IBOutlet UITextField *name;
@property (strong, nonatomic) IBOutlet UITextField *regno;
@property (strong, nonatomic) IBOutlet UITextField *marks;    
@property (strong, nonatomic) IBOutlet UITextField *rank;

- (IBAction)save:(UIButton *)sender;
@end

正如@BiWoj在评论中所说,您正在检查

if (cell==nil)...

依靠这张支票,你可以第一次填写你的数据。这是错误的,您可以将
出列
单元格
,然后当它不是
nil
时,您可以开始将数据放入其
视图
单元格
将为
nil
的唯一原因是当您
使用不存在的标识符出列
时,即它不应该发生。

首先,当您单击“保存”按钮时,只需检查您的委托方法是否被调用

我想你以前忘了将委托设置为self

[delegates didFinishSave:studentArray];
应该是

self.delegate = delegates
[delegates didFinishSave:studentArray];
如果这不起作用,请检查,你是推动学生页从第一页像这样

- (IBAction)addButtonAction:(id)sender {
StudentPage *stdView=[self.storyboard instantiateViewControllerWithIdentifier:@"MyIdentifier"];
 stdView.delegates=self;

[self.navigationController pushViewController:stdView animated:YES];}
再一次,在学生页面的保存操作方法中,您正在像这样推送第一页

FirstPage *firstView=[self.storyboard instantiateViewControllerWithIdentifier:@"MyIdentifier1"];
[self.navigationController pushViewController:firstView animated:YES];
好吧,我想你应该用

[self.navigationController popToRootViewControllerAnimated:YES];

无需再次推送相同的控制器,只需将其弹出到基本控制器。

请先正确设置代码格式您是否连接了表视图的
委托
数据源
?是的,我连接了表视图的委托和数据源“firstPageArray”是否有任何数据。检查值“firstPageArray.count”应大于1在
viewDidLoad
工作中的程序集
delegate
dataSource