I have the following implementation, where I am adding a footerview as a customcell. However, if there is no content, I do not want to show the last cell, if there is I want to show it.
In my current implementation, it always displays the last cell.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return [self.adminOrderElements count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return adminOrderElements[section].products.count + 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row < adminOrderElements[indexPath.section].products.count)
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
NSArray * tempArray = adminOrderElements[indexPath.section].products;
cell.textLabel.text = [[tempArray objectAtIndex:indexPath.row] objectForKey:#"productname"];
return cell;
}
else
{
static NSString *CellIdentifier = #"FooterCell";
FooterTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
cell = [[FooterTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
if(adminOrderElements[indexPath.section].expanded && [adminOrderElements[indexPath.section].notes length]>0)
{
cell.footerLabel.text = [NSString stringWithFormat:#"Notes: %#", adminOrderElements[indexPath.section].notes];
}
else
{
cell.heightConstraints.constant = 1;
cell.footerLabel.text = #"";
}
return cell;
}
}
There is one option that you can make cellHeight to 0.
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(CHECK_IF_NO_CONTAIN)
return 0;
return 40;// Normal height as you want
}
I think you can add condition in else clause like if certain condition is met then you want to display this cell other wise not...
if (indexPath.row < adminOrderElements[indexPath.section].products.count)
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
NSArray * tempArray = adminOrderElements[indexPath.section].products;
cell.textLabel.text = [[tempArray objectAtIndex:indexPath.row] objectForKey:#"productname"];
return cell;
}
else //Here add your condition here if you have content for the section like I think this condition might work [adminOrderElements[indexPath.section].notes length]>0
{
static NSString *CellIdentifier = #"FooterCell";
FooterTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
cell = [[FooterTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
if(adminOrderElements[indexPath.section].expanded && [adminOrderElements[indexPath.section].notes length]>0)
{
cell.footerLabel.text = [NSString stringWithFormat:#"Notes: %#", adminOrderElements[indexPath.section].notes];
}
else
{
cell.heightConstraints.constant = 1;
cell.footerLabel.text = #"";
}
return cell;
}
}
Its quite simple with UITableView delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (dataObjects.count == 0){
return 0;
}
return dataObjects.count;
}
Related
I have created a page where i need to use two table views for adding dynamic options. The problem is that only one table is displaying its data and the other one is not. Am totally confused where did i do wrong.
screen shot of my views.
Below am adding my code-
#interface FlirtMatchViewController ()
{
UILabel *headerTitle;
NSArray *tableData;
NSArray *arrimages;
NSArray *tableData1;
NSArray *arrimages1;
}
#end
#implementation FlirtMatchViewController
- (void)viewDidLoad {
[super viewDidLoad];
tableData = [NSArray arrayWithObjects:#"TattooSingles",#"Eyecatcher",#"Tattoo Toplist",#"Radar",#"Flirt Chat",#"Free VIP Membership",#"VIP Membership",#"Invite Friends",nil];
arrimages = [NSArray arrayWithObjects:#"tatto_single#2x.png",#"eye_catcher.png",#"tatto_toplist.png",#"radar.png",#"Flirt_chat.png",#"free_vip.png",#"vip_membership_navigation.png",#"add-friend1.png", nil];
tableData1 = [NSArray arrayWithObjects:#"TattooSingles",#"Eyecatcher",#"Tattoo Toplist",#"Radar",#"Flirt Chat",#"Free VIP Membership",#"VIP Membership",#"Invite Friends",nil];
arrimages1 = [NSArray arrayWithObjects:#"tatto_single#2x.png",#"eye_catcher.png",#"tatto_toplist.png",#"radar.png",#"Flirt_chat.png",#"free_vip.png",#"vip_membership_navigation.png",#"add-friend1.png", nil];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(tableView==_leftTableView)
{
return [tableData count];
}
else {
return [tableData1 count];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier2 = #"Cell2";
static NSString *CellIdentifier1 = #"Cell1";
if(tableView==self.leftTableView)
{
static NSString *CellIdentifier1 = #"Cell1";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] ;
}
cell.textLabel.text = [tableData objectAtIndex:indexPath.row];
return cell;
}
else
{
static NSString *CellIdentifier2 = #"Cell2";
UITableViewCell *cell1 = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
if (cell1 == nil)
{
cell1= [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier2] ;
}
cell1.textLabel.text = [tableData1 objectAtIndex:indexPath.row];
return cell1;
}
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
TattooSinglesScreen *obj=[self.storyboard instantiateViewControllerWithIdentifier:#"TattooSinglesScreen"];
EyecatcherScreen *obj1=[self.storyboard instantiateViewControllerWithIdentifier:#"EyecatcherScreen"];
TattooToplist *obj2=[self.storyboard instantiateViewControllerWithIdentifier:#"TattooToplist"];
int i=indexPath.row;
if(i==0){
[self.navigationController pushViewController:obj animated:NO];
}
else if (i==1) {
[self.navigationController pushViewController:obj1 animated:NO];
}
else if (i==2) {
[self.navigationController pushViewController:obj2 animated:NO];
}
}
Also am trying to navigate the first three options to their particular screen by using the code below. But the code is not working for me. Can anyone clear my doubts?
What Anbu suggested will work, although could I suggest you create separate classses to handle the datasource and delegate for each UITableView, then simply assign the datasource and delegate to your new classes for each tableview. This will be cleaner and might help resolve the logic issues you have.
Hope this helps, comment if you have any questions, good luck.
do like
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView == self. leftTableView)
{
return [tableData count];
}
if (tableView == self. rightTableView)
{
return [tableData1 count];
}
}
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
if(tableView==self.leftTableView)
{
static NSString *CellIdentifier1 = #"Cell1";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier1];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] ;
}
cell.textLabel.text = [tableData objectAtIndex:indexPath.row];
return cell;
}
if (tableView == self._rightTableView)
{
static NSString *CellIdentifier2 = #"Cell2";
UITableViewCell *cell1 = [tableView dequeueReusableCellWithIdentifier:CellIdentifier2];
if (cell1 == nil)
{
cell1= [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier2] ;
}
cell1.textLabel.text = [tableData1 objectAtIndex:indexPath.row];
return cell1;
}
}
I am trying to implement multiselection in table view. But it is not working. When I add the below code it just shows me the single section for the elements in the table view. When I remove this line from code then I am able to select but not able to deselect the items.
Removed line code:multi selection works but not able to deselect
for (i=0; i<[arr_selectedCells count]; i++) {
NSInteger currentValue = [(NSNumber *)[arr_selectedCells objectAtIndex:i] integerValue];
if (currentValue==indexPath.row) {
cell.accessoryType=UITableViewCellAccessoryCheckmark;
}
}
correct.
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
UserFriend *user_friend=[arr_userFriends objectAtIndex:indexPath.row];
cell.textLabel.text=user_friend.name;
NSLog(#"name is %#",user_friend.name);
int i;
for (i=0; i<[arr_selectedCells count]; i++)
{
NSInteger currentValue = [(NSNumber *)[arr_selectedCells objectAtIndex:i]integerValue];
if(currentValue==indexPath.row)
{
cell.accessoryType=UITableViewCellAccessoryCheckmark;
}
else
{
cell.accessoryType=UITableViewCellAccessoryNone;
}
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(![arr_userFriends containsObject:[NSNumber numberWithInteger:indexPath.row]])
{
[arr_selectedCells addObject:[NSNumber numberWithInteger:indexPath.row]];
}
else
{
[arr_selectedCells removeObject:[NSNumber numberWithInteger:indexPath.row]];
}
NSLog(#"numr is %ld",(long)indexPath.row);
[tableView reloadData];
}
Please tell me where I am going wrong?
i just edited your code! and i hope it works for you
tableView CellForRowAtIndexPath
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
}
UserFriend *user_friend=[arr_userFriends objectAtIndex:indexPath.row];
cell.textLabel.text=user_friend.name;
if([arr_selectedCells containsObject:user_friend.name])
cell.accessoryType = UITableViewCellAccessoryCheckmark;
else
cell.accessoryType = UITableViewCellAccessoryNone;
return cell;
}
didSelectRowAtIndexPath
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UserFriend *user_friend=[arr_userFriends objectAtIndex:indexPath.row];
if([arr_selectedCells containsObject:user_friend.name])
{
[arr_selectedCells removeObject:user_friend.name];
}
else
{
[arr_selectedCells addObject:user_friend.name];
}
[tableView reloadRowsAtIndexPaths:#[indexPath] withRowAnimation:UITableViewRowAnimationNone];
}
try these
tableView.allowsSelection=YES;
tableView.allowsSelectionDuringEditing = YES;
i am facing one module consists to load two different UITableView in same UIViewController i know where i doing mistake, the problem is cell for row AtIndexpath in table view method. i getting only one UITableView in UIViewController but my secondviewcontroller not return any values in cell.
here my sample code for ur reference:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (tableView==table) {
return [self.arryData count];
}
else
return [tblArr count];
NSLog(#"tabeCount==>%lu",(unsigned long)tblArr.count);
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 55;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
static NSString *CellIdentifier1 = #"Cell";
dequeueReusableCellWithIdentifier:CellIdentifier];
UITableViewCell *cell;
mobilePlanDetailsCellTableViewCell *plan_cell;
if (tableView==table) {
cell = [self.table dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.text = [self.arryData objectAtIndex:indexPath.row];
}return cell;
if (tableView==planTable) {
plan_cell = [self.planTable dequeueReusableCellWithIdentifier:CellIdentifier1];
if (plan_cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:#"mobilePlanDetailsCellTableViewCell" owner:self options:nil];
plan_cell = [nib objectAtIndex:0];
}
plan_cell.label.text = [[tblArr objectAtIndex:indexPath.row] objectForKey:#"Answer1"];
plan_cell.Label2.text = [[tblArr objectAtIndex:indexPath.row]objectForKey:#"answer2"];
plan_cell.Label3.text = [[tblArr objectAtIndex:indexPath.row]objectForKey:#"answer3"];
plan_cell.label4.text = [[tblArr objectAtIndex:indexPath.row]objectForKey:#"answer4"];
}
return plan_cell;
}
- (void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView setBackgroundColor:[UIColor whiteColor]];
[cell setBackgroundColor:[UIColor whiteColor]];
}
you made the small mistake just change the Return Cell in inside the method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
if (tableView==table) {
UITableViewCell *cell = [self.table dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.text = [self.arryData objectAtIndex:indexPath.row];
return cell;
}
else {
mobilePlanDetailsCellTableViewCell *plan_cell = [self.planTable dequeueReusableCellWithIdentifier: CellIdentifier];
if (plan_cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:#"mobilePlanDetailsCellTableViewCell" owner:self options:nil];
plan_cell = [nib objectAtIndex:0];
}
plan_cell.label.text = [[tblArr objectAtIndex:indexPath.row] objectForKey:#"Answer1"];
plan_cell.Label2.text = [[tblArr objectAtIndex:indexPath.row]objectForKey:#"answer2"];
plan_cell.Label3.text = [[tblArr objectAtIndex:indexPath.row]objectForKey:#"answer3"];
plan_cell.label4.text = [[tblArr objectAtIndex:indexPath.row]objectForKey:#"answer4"];
return plan_cell;
}
}
The problem is that you are returning the cell outside the if (tableView==table), so your program will NOT reach the code after it.
Instead of
if (tableView==table) {
cell = [self.table dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.text = [self.arryData objectAtIndex:indexPath.row];
}return cell; //This line is wrong
You should do this:
if (tableView==table) {
cell = [self.table dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.textLabel.text = [self.arryData objectAtIndex:indexPath.row];
//Should be inside the if scope
return cell;
}
Why you are doing such complex coding, Just simply provide different tag value for Table Views, and you are returning cell outside of your if condition which is wrong. Follow the below code.
Do a checking like this:-
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(tableView.tag==1)// Table 1
{
//load cell as per your choice
//cell operations
return cell;
}
else // Table 2
{
//load cell as per your choice
//cell operations
return cell;
}
I want to divide the cells in groups as per condition but i am getting repeated values where i am wrong.
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 5;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(section == 0)
{
return 1;
}
else if(section == 1)
{
return 6;
}
else if(section ==2)
{
return 2;
}
else
{
return [arrControls count]-9;
}
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = #"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
cell.textLabel.text = [arrControls objectAtIndex:indexPath.row];
return cell;
}
Use an array of NSMutableArrays for each section.
NSMutableArray *arrays[5];
for (int i = 0; i < 5;i++)
{
arrays[i] = [[NSMutableArray alloc]init];
}
[arrays[0] addObject:#"add Your objects in section 0"];
[arrays[1] addObject:#"add Your objects in section 1"];
[arrays[2] addObject:#"add Your objects in section 2"];
etc..
Then.
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
array[section].count
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = #"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
cell.textLabel.text = [array[indexPath.section] objectAtIndex:indexPath.row];
return cell;
}
inside your cellForRowAtIndexPath , u need to return different cells for different section
Let say u have the 3 custom classes( with inferface for all of them ) inherited from UITableViewCell
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(inderPath.Section ==0 )
{
//assuing that custom class name is detailTableViewCell.h and interface file name is same .
static NSString *simpleTableIdentifier = #detailTableViewCell ;
detailTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]
if(cell == nil )
{
NSArray *nib= [[NSBundle mainBundle] loadNibNamed:#"detailTableViewCell" ownder self options:nil];
cell = [nib objectAtIndex:0]
}
return cell ;
}
if(inderPath.Section ==1 )
{
similarly for another subclass of UItableViewCell ;
}
if(inderPath.Section ==2 )
{
similarly for another subclass of UItableViewCell ;
}
// one common cell for other sections
NSString *cellIdentifier = #"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
cell.textLabel.text = [arrControls objectAtIndex:indexPath.row];
return cell;
}
try this`-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *cellIdentifier = #"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if(indexPath.section == 0)
{
cell.textLabel.text = [firstArray objectAtIndex:indexPath.row];
}
else if (indexPath.section == 1)
{
cell.textLabel.text = [secondArray objectAtIndex:indexPath.row];
}
else if (indexPath.section == 2)
{
cell.textLabel.text = [thirdArray objectAtIndex:indexPath.row];
}
else if (indexPath.section == 3)
{
cell.textLabel.text = [thirdArray objectAtIndex:indexPath.row];
}
else
{
cell.textLabel.text = [FourthArray objectAtIndex:indexPath.row];
}
return cell;
}
`
#Dalvik. You need different array for each section. And you already have only one mutableArray.
You can take the array where each object in array will give you array for the rows.
The format of data you can use is as follows
(
{key : Array},
{key : Array},
{key : Array},
{key : Array},
)
or simply
(
(Array),
(Array),
)
inside, numberOfRowsInSection: you can access it using
{
return [[[dataArray objectAtIndex:section]ObjectFoyKey:key]count];
or
return [[dataarray objectAtIndex:section]count];
}
inside, cellFOrRowAtIndexPath: you can access it using
{
array = [[dataArray objectAtIndex:section]ObjectFoyKey:key];
cell.textlabel.text = [array objectAtIndex:indexPath.row];
or
array = [dataArray objectAtIndex:section];
cell.textlabel.text = [array objectAtIndex:indexPath.row];
}
Hope this will help you..
Please elaborate your question a little bit. Its hard to understand what exactly your problem is.
In case you are using xib or storyboard for tableCell use this approach 1:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"MyCellIdentifier";
MyCell *cell = (MyCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellIdentifier owner:self options:nil];
cell = (MyCell *)[nib objectAtIndex:0];
}
In case you are not using storyboard for cell try this approach 2:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"MyCellIdentifier";
UITableViewCell *cell = (MyCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
[cell setNeedsDisplay];
}
Hope this will help you..
how to display a number from 1 to array count in a table row .
am using following code.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
// NSInteger WeekList=[WeekArry count];
}
NSInteger row = indexPath.row;
cell.textLabel.text=[NSString stringWithFormat:#"Week %ld",(long)row];
NSLog(#"row%ld",(long)indexPath.row);
// Configure the cell...
return cell;
}
if (row == array.count) {
cell.textLabel.text=[NSString stringWithFormat:#"Week %ld",(long)row];
}else{
cell.textLabel.text=[NSString stringWithFormat:#"Week %ld",(long)row + 1];
}