UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell" forIndexPath:indexPath];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
UISwitch *clickButton = (UISwitch *)[cell viewWithTag:30];
clickButton.tag = indexPath.row;
[clickButton addTarget:self action:#selector(cellButtonClickAction:) forControlEvents:UIControlEventTouchUpInside];
UILabel *title = (UILabel*)[cell viewWithTag:80];
UILabel *description = (UILabel*)[cell viewWithTag:81];
UIView *innerView = (UIView *)[cell viewWithTag:82];
innerView.layer.borderColor=[[UIColor colorWithRed:229/255.0f green:229/255.0f blue:229/255.0f alpha:1.0] CGColor];
innerView.layer.borderWidth = 2.0f;
NSDictionary *displayDict = scenarioListsArray[indexPath.row];
title.text =[displayDict objectForKey:#"name"];
description.text = [displayDict objectForKey:#"description"];
if ([[displayDict objectForKey:#"status"] isEqualToString:#"ACTIVE"]) {
[clickButton setOn:YES animated:YES];
NSLog(#"SWITCH %ld",clickButton.tag);
}
else
{
[clickButton setOn:NO animated:YES];
}
i need to change the state of Switch depends on Array but switch state not change on array.
Related
I'm creating a UISwitch programmatically in one of the tableview datasource function(cell for row at index). when I'm scrolling the table view, the OFF state switches are malfunctioned(UI) two rounds appeared. Attaching the screenshot of the switch.
Appreciate your help!
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell" forIndexPath:indexPath];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
UILabel *title = (UILabel*)[cell viewWithTag:80];
UILabel *description = (UILabel*)[cell viewWithTag:81];
UIView *innerView = (UIView *)[cell viewWithTag:82];
innerView.layer.borderColor=[[UIColor colorWithRed:229/255.0f green:229/255.0f blue:229/255.0f alpha:1.0] CGColor];
innerView.layer.borderWidth = 2.0f;
NSDictionary *displayDict = scenarioListsArray[indexPath.row];
title.text =[displayDict objectForKey:#"name"];
description.text = [displayDict objectForKey:#"description"];
UISwitch *myswitch = [[UISwitch alloc]initWithFrame:CGRectMake(cell.contentView.frame.size.width-60, (cell.contentView.frame.size.height/2)-20 , 100, 100)];
myswitch.onTintColor = [UIColor colorWithRed:25/255.0f green:122/255.0f blue:66/255.0f alpha:1];
[cell.contentView addSubview:myswitch];
myswitch.tag = indexPath.row;
[myswitch addTarget:self action:#selector(cellButtonClickAction:) forControlEvents:UIControlEventValueChanged];
if ([[displayDict objectForKey:#"status"] isEqualToString:#"ACTIVE"]) {
[myswitch setOn:YES animated:YES];
}
else
{
[myswitch setOn:NO animated:YES];
}
return cell;
}
I have faced the same issue and fixed with following code before creating switch
for(UIView *subView in cell. contentView.subviews){
if ([subView isKindOfClass:[UISwitch class]]) {
[subView removeFromSuperview];
}
}
Or
static NSString *TableIdentifier = #"YourCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:TableIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:TableIdentifier];
//place your all UI elements code here.
}
I have updated your code, try this will work for you,
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell" forIndexPath:indexPath];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
UILabel *title = (UILabel*)[cell viewWithTag:80];
UILabel *description = (UILabel*)[cell viewWithTag:81];
UIView *innerView = (UIView *)[cell viewWithTag:82];
innerView.layer.borderColor=[[UIColor colorWithRed:229/255.0f green:229/255.0f blue:229/255.0f alpha:1.0] CGColor];
innerView.layer.borderWidth = 2.0f;
NSDictionary *displayDict = scenarioListsArray[indexPath.row];
title.text =[displayDict objectForKey:#"name"];
description.text = [displayDict objectForKey:#"description"];
UISwitch *myswitch = [cell.contentView viewWithTag:indexPath.row+597];
if(mySwitch == nil){
myswitch = [[UISwitch alloc]initWithFrame:CGRectMake(cell.contentView.frame.size.width-60,(cell.contentView.frame.size.height/2)-20 , 100, 100)];
[cell.contentView addSubview:myswitch];
[myswitch addTarget:self action:#selector(cellButtonClickAction:) forControlEvents:UIControlEventValueChanged];
}
myswitch.onTintColor = [UIColor colorWithRed:25/255.0f green:122/255.0f blue:66/255.0f alpha:1];
myswitch.tag = indexPath.row+597; //597 is extra number added to tag
if ([[displayDict objectForKey:#"status"] isEqualToString:#"ACTIVE"]) {
[myswitch setOn:YES animated:YES];
}
else
{
[myswitch setOn:NO animated:YES];
}
return cell;
}
I want a button to show when i select a cell, when i select the same cell or another cell i want the button to hide. So one button should only be visible at a time.
What i have:
in my .h file:
#property (strong, nonatomic) NSIndexPath *isselectednow;
and my .m file:
Viewdidload:
self.isselectednow = [NSIndexPath indexPathForRow:7 inSection:1];
cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
//[cell addSubview:[self drawSeparationView:(indexPath.row)]];
UILabel *DateName = (UILabel *)[cell viewWithTag:100100];
DateName.textColor = [UIColor blackColor];
//DateName.text = [NSString stringWithFormat:#"%ld",(long)indexPath.row ];
DateName.text = objects[indexPath.row];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:#selector(buttonOnCellPressed:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:#"Update" forState:UIControlStateNormal];
button.frame = CGRectMake(DEVICE_SIZE.width - 60, 18, 55, 15);
[cell addSubview:button];
if ([indexPath compare:self.isselectednow] == NSOrderedSame) {
button.hidden = NO;
}
else{
button.hidden = YES;
}
UILabel *lbl1 = (UILabel *)[cell viewWithTag:100101];
lbl1.textColor = UIColorFromRGB(0x141414);
UILabel *lbl2 = (UILabel *)[cell viewWithTag:100102];
lbl2.textColor = UIColorFromRGB(0x141414);
UILabel *lbl3 = (UILabel *)[cell viewWithTag:100103];
lbl3.textColor = UIColorFromRGB(0x141414);
UILabel *lbl4 = (UILabel *)[cell viewWithTag:100104];
lbl4.textColor = UIColorFromRGB(0x141414);
UILabel *lbl5 = (UILabel *)[cell viewWithTag:100105];
lbl5.textColor = UIColorFromRGB(0x141414);
UITextField *breakfastName = (UITextField *) [cell viewWithTag:100200];
breakfastName.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:#"Name here"
attributes:#{NSForegroundColorAttributeName:UIColorFromRGB(0x141414)}];
breakfastName.textColor = UIColorFromRGB(0x141414);
[breakfastName setDelegate:self];
//[breakfastName addTarget:self action:#selector(textChanged:) forControlEvents:UIControlEventEditingChanged];
UITextField *OutName = (UITextField *) [cell viewWithTag:100201];
OutName.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:#"Name here"
attributes:#{NSForegroundColorAttributeName:UIColorFromRGB(0x141414)}];
OutName.textColor = UIColorFromRGB(0x141414);
[OutName setDelegate:self];
UITextField *lunchName = (UITextField *) [cell viewWithTag:100202];
lunchName.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:#"Name here"
attributes:#{NSForegroundColorAttributeName:UIColorFromRGB(0x141414)}];
lunchName.textColor = UIColorFromRGB(0x141414);
[lunchName setDelegate:self];
UITextField *InName = (UITextField *) [cell viewWithTag:100203];
InName.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:#"Name here"
attributes:#{NSForegroundColorAttributeName:UIColorFromRGB(0x141414)}];
InName.textColor = UIColorFromRGB(0x141414);
[InName setDelegate:self];
UITextField *eveningName = (UITextField *) [cell viewWithTag:100204];
eveningName.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:#"Name here"
attributes:#{NSForegroundColorAttributeName:UIColorFromRGB(0x141414)}];
eveningName.textColor = UIColorFromRGB(0x141414);
[eveningName setDelegate:self];
UITextField *othersName = (UITextField *) [cell viewWithTag:100205];
othersName.attributedPlaceholder =
[[NSAttributedString alloc]
initWithString:#"Name here"
attributes:#{NSForegroundColorAttributeName:UIColorFromRGB(0x141414)}];
othersName.textColor = UIColorFromRGB(0x141414);
cell.clipsToBounds = YES;
cell.accessoryType = UITableViewCellAccessoryNone;
cell.backgroundColor = UIColorFromRGB(0xf3f0e9);
return cell;
}
didSelectRowAtIndexPath:
[tableView beginUpdates];
if ([indexPath compare:self.isselectednow] == NSOrderedSame) {
self.isselectednow = nil;
}
else{
self.isselectednow = indexPath;
}
[tableView endUpdates];
//[tableView reloadData];
From the docs about beginUpdates:
Call this method if you want subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously.
Although you've changed the isSelectedNow boolean, you haven't actually specified any insertion, deletion, or selection operations between beginUpdates and endUpdates. So you're not actually beginning or ending any updates to the cells' content with that code.
I'm not sure what you're trying to do, but taking out [tableView beginUpdates]; and [tableView beginUpdates]; and reinserting [tableView reloadData]; would result in a proper data reload.
Edit:
Aside from that, the problem is that you're reusing your cells with dequeueReusableCellWithIdentifier:, but you're adding a new UIButton subview each time, so you're basically putting each new UIButton over the old. I suggest doing what you've done for all your labels and textfields in cellForRowAtIndexPath: -- reuse your update button by adding it to your custom table view cell and accessing it with viewWithTag:.
I create a tableview has button, this button has been changed image ass different condition. The first load tableview, these buttons set image correct but after condition change, it set image incorrect. Example : If [Selling = 0] , set image "Market.png", else [Selling =2], set image "MarketSelect.png". When value of Selling array changing, i used [_tableview reloadData] but it still not change image. I debug, i see MarketButton is 0x0000. The first load, MarketButton works correct but second load, it is 0x0000. Please give me advice to solve this problem. I tried 2 days but it can not works. thanks much
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (nil == cell) {
cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.button.tag = indexPath.row;
UIButton *market = [UIButton buttonWithType:UIButtonTypeCustom];
[market setFrame:CGRectMake(200, 6, 30, 30)];
market.tag = 4000;
[market addTarget:self action:#selector(marketPressedAction:) forControlEvents:UIControlEventTouchDown];
[cell.contentView addSubview:market];
UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 0, 80, 30)];
pricelabel.backgroundColor = [UIColor clearColor];
pricelabel.font = [UIFont fontWithName:#"Helvetica" size:16];
pricelabel.font = [UIFont boldSystemFontOfSize:16];
pricelabel.textColor = [UIColor darkGrayColor];
pricelabel.tag = 3000;
//pricelabel.hidden = YES;
pricelabel.textAlignment = NSTextAlignmentRight;
[cell.contentView addSubview: pricelabel];
[pricelabel release];
}
UIButton *marketButton = (UIButton*)[cell.contentView viewWithTag:4000];
[marketButton setTag:indexPath.row];
if([sellingArray count]>0)
{
NSLog(#"sellingArray %#",sellingArray);
if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"0"]) // nothing
{
[marketButton setSelected:NO];
[marketButton setImage:[UIImage imageNamed:#"Marketplace.png"] forState:UIControlStateNormal];
marketButton.enabled = YES;
}
else if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"2"]) // marketplace
{
[marketButton setSelected:YES];
[marketButton setImage:[UIImage imageNamed:#"MarketplaceSelect.png"] forState:UIControlStateNormal];
marketButton.enabled = YES;
}
}
}
UILabel *pricelbl = (UILabel*)[cell.contentView viewWithTag:3000];
pricelbl.text =[NSString stringWithFormat:#"$%#",[priceNewArray objectAtIndex:indexPath.row]];
if ([sellingArray count]>0) {
if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"2"]){
pricelbl.hidden = NO;
}
else if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"0"]){
pricelbl.hidden = YES;
}
}
return cell;
}
marketpressAction :
- (void)marketPressedAction:(id)sender
{
buttonPressed = (UIButton *)sender;
buttontag = buttonPressed.tag;
NSLog(#"Market button click at row %d",buttontag);
}
I added UIButton to each uitableview row but when i nedd reloadData, uibutton is 0x0000. Can you give me any suggestions? Thanks much.
I used this code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
/*NSString *CellIdentifier = [NSString stringWithFormat:#"%d,%d",indexPath.section,indexPath.row];
// NSString *CellIdentifier = #"cell";
UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{*/
NSString *CellIdentifier = [NSString stringWithFormat:#"%d,%d",indexPath.section,indexPath.row];
UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 0, 80, 30)];
pricelabel.backgroundColor = [UIColor clearColor];
pricelabel.font = [UIFont fontWithName:#"Helvetica" size:16];
pricelabel.font = [UIFont boldSystemFontOfSize:16];
pricelabel.textColor = [UIColor darkGrayColor];
pricelabel.tag = 3000;
//pricelabel.hidden = YES;
pricelabel.textAlignment = NSTextAlignmentRight;
[cell.contentView addSubview: pricelabel];
[pricelabel release];
UIButton * market = [[UIButton alloc] init];;
[market setFrame:CGRectMake(200, 6, 30, 30)];
market.tag = 4000;
[market addTarget:self action:#selector(marketPressedAction:) forControlEvents:UIControlEventTouchDown];
// [market setTag:indexPath.row];
[cell.contentView addSubview:market];
}
if([priceNewArray count]> 0)
{
UILabel *pricelbl = (UILabel*)[cell.contentView viewWithTag:3000];
pricelbl.text =[NSString stringWithFormat:#"$%#",[priceNewArray objectAtIndex:indexPath.row]];
if ([sellingArray count]>0) {
if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"2"]){
pricelbl.hidden = NO;
}
else if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"0"]){
pricelbl.hidden = YES;
}
}
}
UIButton *marketButton = (UIButton*)[cell.contentView viewWithTag:4000];
[marketButton setTag:indexPath.row];
if([sellingArray count]>0)
{
NSLog(#"sellingArray %#",sellingArray);
if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"0"]) // nothing
{
[marketButton setSelected:NO];
[marketButton setImage:[UIImage imageNamed:#"Marketplace.png"] forState:UIControlStateNormal];
marketButton.enabled = YES;
}
else if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:#"2"]) // marketplace
{
[marketButton setSelected:YES];
[marketButton setImage:[UIImage imageNamed:#"MarketplaceSelect.png"] forState:UIControlStateNormal];
marketButton.enabled = YES;
}
}
_tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
return cell;
}
I used above code, when reloadData, data of Price label is changed fine but marketbutton can not changed image. I debug after call [_tableview reloadData];, marketButton is 0x0000 .
I think your comparison is not correct. You are trying to compare integer with string.
If i asumed correct then try something like this.
int sellingPrice=0;
if([[sellingArray objectAtIndex:indexPath.row] isEqualToString: [NSString stringWithFormat:#"%i",sellingPrice]]) // nothing
sellingPrice=2;
else if([[sellingArray objectAtIndex:indexPath.row] isEqualToString:[NSString stringWithFormat:#"%i",sellingPrice]]) // marketplace
use single CellIdentifier for cell when using same designs for cell,it used to reuse tableview cells
NSString *CellIdentifier = #"Cell"
please remove this code [marketButton setTag:indexPath.row]; you not want to change tag for cell,you not set tag for identifier for UIButton, change this two thinks your code will work
I have a custom UITableView Cell. It contains a custom button with image that shows a check box which can be tapped to show a checked and unchecked image. It works correctly, but once filtering begins using UISearchBarController tapping my custom button within a cell the image does not update properly. Are the results shown in perhaps a different tableview? The methods to update the cell are all called, but the image does not change.
What is more perplexing is: Scrolling the cell out of view and back causes the cell to be displayed correctly.
#define MAINLABEL_TAG 1
#define SECONDLABEL_TAG 2
#define CHECKBOX_TAG 3
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UILabel *mainLabel, *secondLabel;
UIButton *button = [UIButton buttonWithType: UIButtonTypeCustom];
PDFFile *newPDF = [_pdfDocumentFiltered.pdfFileList objectAtIndex: indexPath.row];
//compute label sizes
GLfloat heightOfName = [TextSize computeHeightWithBoldFont: newPDF.documentTitle andViewWidth: 250 andFontSize: 18];
CGFloat heightOfDescription = [TextSize computeHeight: newPDF.description andViewWidth: 250 andFontSize: 16];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryNone;
//set main label attributes
mainLabel = [[UILabel alloc] initWithFrame:CGRectMake(60.0, 5.0, 250.0, heightOfName)];
mainLabel.tag = MAINLABEL_TAG;
mainLabel.font = [UIFont boldSystemFontOfSize: 18.0];
mainLabel.textAlignment = UITextAlignmentLeft;
mainLabel.textColor = [UIColor blackColor];
mainLabel.autoresizingMask = UIViewAutoresizingNone;
mainLabel.numberOfLines = 9;
mainLabel.lineBreakMode = UILineBreakModeWordWrap;
[cell.contentView addSubview:mainLabel];
//set second label attributes
secondLabel = [[UILabel alloc] initWithFrame:CGRectMake(60.0, heightOfName + 10, 250.0, heightOfDescription)];
secondLabel.tag = SECONDLABEL_TAG;
secondLabel.font = [UIFont systemFontOfSize:16.0];
secondLabel.textAlignment = UITextAlignmentLeft;
secondLabel.textColor = [UIColor darkGrayColor];
secondLabel.autoresizingMask = UIViewAutoresizingNone;
secondLabel.numberOfLines = 20;
secondLabel.lineBreakMode = UILineBreakModeWordWrap;
[cell.contentView addSubview:secondLabel];
[button setFrame: CGRectMake(5.0, 0.0, 52.0, heightOfName + heightOfDescription + 15)];
[button setTag: CHECKBOX_TAG];
[button addTarget: self action: #selector(checkUncheck:) forControlEvents: UIControlEventTouchUpInside];
[cell.contentView addSubview:button];
} else {
mainLabel = (UILabel *)[cell.contentView viewWithTag:MAINLABEL_TAG];
[mainLabel setFrame: CGRectMake(60.0, 0.0, 250.0, heightOfName)];
secondLabel = (UILabel *)[cell.contentView viewWithTag:SECONDLABEL_TAG];
[secondLabel setFrame: CGRectMake(60.0, heightOfName + 10, 250.0, heightOfDescription)];
button = (UIButton *)[cell.contentView viewWithTag:CHECKBOX_TAG];
[button setFrame: CGRectMake(5.0, 0.0, 52.0, heightOfName + heightOfDescription + 15)];
}
mainLabel.text = newPDF.documentTitle;
secondLabel.text = newPDF.description;
if ([newPDF.check boolValue] == YES)
{
NSLog(#"Updating image to YES %i", indexPath.row);
[button setImage: [UIImage imageNamed: #"ButtonCheck"] forState: UIControlStateNormal];
}else{
NSLog(#"Updating Image to NO");
[button setImage: [UIImage imageNamed: #"ButtonUncheck"] forState: UIControlStateNormal];
}
cell.tag = indexPath.row;
return cell;
}
- (IBAction) checkUncheck:(id)sender
{
UIButton *sendingButton = (UIButton *) sender;
UITableViewCell *cell = (UITableViewCell *)[[sendingButton superview] superview];
PDFFile *newPDF = [_pdfDocumentFiltered.pdfFileList objectAtIndex: cell.tag];
[newPDF setCheck: [NSNumber numberWithBool: ![newPDF.check boolValue]]];
[self.table reloadData];
}
You should not tag the cell but you should tag the button correctly.
[button setTag: indexPath.row]; //Tag it properly
button = (UIButton *)[cell.contentView viewWithTag:indexPath.row]; //Fetch it properly
In IBAction,
- (IBAction) checkUncheck:(id)sender
{
UIButton *sendingButton = (UIButton *) sender;
PDFFile *newPDF = [_pdfDocumentFiltered.pdfFileList objectAtIndex: sendingButton.tag];
[newPDF setCheck: [NSNumber numberWithBool: ![newPDF.check boolValue]]];
[self.table reloadData];
}
Reloading the searchDisplayController is necessary. Not sure why but adding this line solves the problem:
[self.searchDisplayController.searchResultsTableView reloadData];
So the updated method is the following:
- (IBAction) checkUncheck:(id)sender
{
UIButton *sendingButton = (UIButton *) sender;
UITableViewCell *cell = (UITableViewCell *)[[sendingButton superview] superview];
PDFFile *newPDF = [_pdfDocumentFiltered.pdfFileList objectAtIndex: cell.tag];
[newPDF setCheck: [NSNumber numberWithBool: ![newPDF.check boolValue]]];
[self.table reloadData];
[self.searchDisplayController.searchResultsTableView reloadData];
}