Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 例如: tblView = [[UITableView alloc] initWithFrame:CGRectMake(100,200,320,420) style: UITableViewStyleGrouped]; tblView.delegate = self; tblView.dataSource = self; [self.view addSubview:tblView];_Objective C_Xcode - Fatal编程技术网

Objective c 例如: tblView = [[UITableView alloc] initWithFrame:CGRectMake(100,200,320,420) style: UITableViewStyleGrouped]; tblView.delegate = self; tblView.dataSource = self; [self.view addSubview:tblView];

Objective c 例如: tblView = [[UITableView alloc] initWithFrame:CGRectMake(100,200,320,420) style: UITableViewStyleGrouped]; tblView.delegate = self; tblView.dataSource = self; [self.view addSubview:tblView];,objective-c,xcode,Objective C,Xcode,您所指的这些方法是委托方法,与其他普通方法不同,它们不能直接激发 希望对你有帮助 确保已设置tableview的委托和数据源。请参阅重复:确保已设置tableview的委托和数据源。请参阅重复:确保已设置tableview的委托和数据源。请参阅重复:确保已设置tableview的委托和数据源。请参阅重复: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sec

您所指的这些方法是委托方法,与其他普通方法不同,它们不能直接激发


希望对你有帮助

确保已设置tableview的
委托和数据源
。请参阅重复:确保已设置tableview的
委托和数据源
。请参阅重复:确保已设置tableview的
委托和数据源
。请参阅重复:确保已设置tableview的
委托和数据源
。请参阅重复:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

// Return the number of rows in the section.
return self.GPTNotifications.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath     *)indexPath
{

static NSString *CellIdentifier = @"Cell";
static NSString *CellIdentifierRead = @"CellRead";

UITableViewCell *cell;


notifications *n = [self.GPTNotifications objectAtIndex:indexPath.row];



   if (n.read == false) {
    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];



    CustomCellRead *cellReadB = (CustomCellRead *)cell;
    cellReadB.notifTitle.text = n.notifTitleD;
    cellReadB.notifDate.text = n.notifDateD;
    cellReadB.notifMsg.text = n.notifMessage;


 return cellReadB;
}

 else {
    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifierRead     forIndexPath:indexPath];



    CustomCell *cellReadB = (CustomCell *)cell;
    cellReadB.notifTitle.text = n.notifTitleD;
    cellReadB.notifDate.text = n.notifDateD;
    cellReadB.notifMsg.text = n.notifMessage;


    return cellReadB;

    }


 }
self.myTableView.delegate = self;
self.myTableView.dataSource = self;
@interface NotificationsListTVController : UIViewController <UITableViewDelegate, UITableViewDataSource>
@interface NotificationsListTVController : UIViewController<UITableViewDataSource,UITableViewDelegate>
 tableView.delegate=self ;
 tableView.dataSource=self;
   tblView = [[UITableView alloc] initWithFrame:CGRectMake(100,200,320,420) style: UITableViewStyleGrouped];


   tblView.delegate = self;
   tblView.dataSource = self;

   [self.view addSubview:tblView];