Tag Archives: uitableview

How can I tell if a UITableView contains a specific NSIndexPath?

Questions: Here is the code I’m using: if (appDelegate.currentMainIndexPath != nil /* && doesPathExistInTableView */) { [tblView scrollToRowAtIndexPath:appDelegate.currentMainIndexPath atScrollPosition:UITableViewScrollPositionTop animated:NO]; appDelegate.currentMainIndexPath = nil; } Answers: You could try to get UITableViewCell by : – (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath; // returns nil if cell is not visible or index path is out of range here’s the complete… Read More »

How to detect edit mode on iPhone UITableView

Questions: For my iPhone app, I have an editable (for delete) table view. I’d like to be able to detect that the user has clicked the “Edit” button. See this image: http://grab.by/It0 From the docs, it looked like if I implemented : – (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath then I could detect it (although from the… Read More »

How to set a uitableviewcell unclickable on the iphone sdk

Questions: Hi I’m trying to have my uitableviewcell rendered inactive so that a user can’t click but merely say the data in the cell. I attempt to do so with: UITableViewCell *cell = nil; if (indexPath.row < factsCount) { static NSString *FactsCellIdentifier = @”FactsCell”; cell = [tableView dequeueReusableCellWithIdentifier:FactsCellIdentifier]; [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; However the cell can still… Read More »

Setting the editing style on a UITableViewCell

Questions: I’m trying to set the editing style property of a UITableViewCell in a Cocoa Touch (iPhone) app. For an example of what this looks like, check out the Contacts app, where you can see the little green plus sign to the left of some of the cells. The UITableViewCell inspector in Interface Builder has… Read More »

Hide footer view in UITableView

Questions: I have been working to hide the footerview for while. My problem is I have a button in footer when I click the button one section will be added below as the last section and the button too will shift to the newly created section and now I want to hide the footer in… Read More »

how to add searchbar in uitableview?

Questions: I have an NSMutableArray displayed in a UITableView, and I have added some elements there. For example, element names are First, FirstTwo, Second, SecondTwo, Third, ThirdTwo. Now I want to add a search bar in the screen. In that search bar when I type F, the table should only show First and FirstTwo. How… Read More »

How can I change the font size of my UITableView cell title?

Questions: How can I change the font size of my UITableView cell title in XCode? Thanks Answers: If you are doing this programatically, then you can set the property cell.textLabel.font in your tableView:cellForRowAtIndexPath method. Specifically, to change the size, you would write: cell.textLabel.font = [UIFont systemFontOfSize:12.0]; Which would resize your font to size 12.0 pts.… Read More »

UITableView tap to deselect cell

Questions: I have a UITableViewCell that is selected when tapped. During this selected state, if the user taps the cell again, I want the cell to deselect. I can’t find any of the delegate calls being hit. Any ideas how to implement this? Is it really going to be a gesture recognizer? Answers: You can… Read More »

How to display scrollbar in UITableView

Questions: I want to display some kind of indication to guide user to scroll. Usually when we touch the UITableView scrollbar appears if needed. But I want this scrollbar indication already displayed on my tableview. How is it possible to do so? Answers: If you have a table view that goes offscreen, you can call… Read More »