Tag Archives: uitableview

Adding cells programmatically to UITableView

Questions: I’ve just recently started programming for the iPhone and I’m making an application that connects to a database and gets a set of row names and displays them. When selected, the rows background colour change ie you can make multiple selections and they will all be different colours. So I’m getting the XML back… Read More »

How to prevent UITableView from reserving space at the left of cell when editing is turned on?

Questions: I’m set editing mode for UITableView to have a possibility of cell reordering. UITableViewCellEditingStyleNone is returned by editingStyleForRowAtIndexPath: method for every cell, but it reserve some area on the left of cell. Is it possible to prevent such an area reserving, because I’m not need an insert or delete icon on left? In short,… Read More »

prepareForSegue not called when UITableView row selected?

Questions: I have setup a UITableView using a NSFetchedResultsController that displays a number of prototype UITableViewCells. I have hooked up a push segue from my UITableViewCell to my DetailViewController. In my TableViewController I have implemented both: – (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@”%s”, __PRETTY_FUNCTION__); [tableView deselectRowAtIndexPath:indexPath animated:YES]; } – (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { NSLog(@”%s”, __PRETTY_FUNCTION__);… Read More »

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 »