這是我的問題。我創建了一個視圖控制器,並在其中插入了一個表格視圖(包含一個單元格)。我在視圖控制器的底部也有一個文本字段。目標是將單元格寫入文本字段中。我嘗試了很多東西,但沒有結果。 任何人都可以幫助我嗎?在視圖控制器中設置表格視圖
這裏是我的代碼(我無法顯示的NSLog)
My .h
@interface RBChatViewController : UIViewController<UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource>
@property (strong, nonatomic) IBOutlet UITextField *entryTextField;
@property (strong, nonatomic) IBOutlet UITableView *tableview;
My .m
#import "RBChatViewController.h"
@interface RBChatViewController()
@end
@implementation RBChatViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.entryTextField.delegate=self;
self.tableview.delegate=self;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
NSLog(@" numberofsections");
return 1;
}
您需要發佈您嘗試過的內容並解釋您遇到的問題。 – rmaddy