Note that there are some explanatory texts on larger screens.

plurals
  1. POSection in UI Table control
    primarykey
    data
    text
    <p>i created 3 sections in UI table View with Different heading(header) ,now i am loading data into the cells directly , its working fine with section1(indexPath.section == 0) and Section2(indexPath.section == 1). but its not taking the section3(indexPath.section == 2). can anyone tell me my mistake.</p> <p>here is the Code.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [mainTable dequeueReusableCellWithIdentifier:CellIdentifier]; // cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:nil]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; if(indexPath.section == 0) { cell.textLabel.text = @"Insite Mobile App Delegate"; cell.detailTextLabel.text = @"Hi, Make following Changes in"; cell.textLabel.textColor = [UIColor whiteColor]; UILabel *dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(180, -8, 300, 40)]; dateLabel.textColor = [UIColor grayColor]; dateLabel.font = [UIFont systemFontOfSize:12]; dateLabel.backgroundColor = [UIColor clearColor]; dateLabel.text = @"Feb 06, 2013"; [cell addSubview:dateLabel]; } if(indexPath.section == 1) { cell.textLabel.textColor = [UIColor whiteColor]; cell.textLabel.text = @"Insite Mobile App Delegate"; cell.detailTextLabel.text = @"Hi, Make following Changes in"; UILabel *titleTextField = [[UILabel alloc]initWithFrame:CGRectMake(10,-10, 300, 40)]; titleTextField.text = @"Anary, Zubin"; titleTextField.textColor = [UIColor whiteColor]; titleTextField.backgroundColor = [UIColor clearColor]; titleTextField.font = [UIFont boldSystemFontOfSize:16]; [cell addSubview:titleTextField]; UILabel *dateLabel = [[UILabel alloc]initWithFrame:CGRectMake(180, -8, 300, 40)]; dateLabel.textColor = [UIColor grayColor]; dateLabel.font = [UIFont systemFontOfSize:12]; dateLabel.backgroundColor = [UIColor clearColor]; dateLabel.text = @"Feb 06, 2013"; [cell addSubview:dateLabel]; } else if(indexPath.section == 2) { cell.detailTextLabel.text = @"Daily Mobile Touch Base"; cell.textLabel.textColor = [UIColor whiteColor]; cell.textLabel.text = @"1:00 pm – 1:30 | M1 - 5026 "; cell.imageView.image = [UIImage imageNamed:@"iPhone_webx.png"]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.imageView.image = [UIImage imageNamed:@"iPhone_webx.png"]; } }cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {if(section==0){ return 4;} else if(section==1) { return 3; } else if (section==2) { return 3; } else return 0; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {return 3;} </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload