Tag Archives: uitableview

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 »

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 »