UITableView not bouncing and cells not being selected - objective-c

First of all, I know this question has already been asked but the answer did not solve my problem.
So, Im in XCode 4.2. I am loading a table View and trying to select a row. The row does not seem to be selected. I also tried NSlogging in the
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{}
but the method is not called at all. Also, the table does not bounce.
FYI, I have set the bounce and selection properties in IB.
Can someone please help me out?
Thank You!

Did you set the delegate of your table view to whichever class has didSelectRowAtIndexPath defined, something like:
sometableview.delegate = self;

Related

Rounded UITableView with thin edges like FaceTime app

How i can create tableview like this?
(separators merges with edges and edges is rounded)
This was out of the box in system version below 7.0. If you want something similar, you can make custom graphic for the first and last cell. In UITableViewDataSource you have got a method, which helps you to control cell's content.
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
From indexPath.row you can get cell number to know if it is first or last cell in the section. And you can set your custom cell look.
You can simply add UITextfields without background [UIColor clearColor] and put a background image to your login cell
If you would like to use table view with rounded corner you should go with QuartzCore framework by importing
#import <QuartzCore/QuartzCore.h>
then
in your method from where you create table view use following code -
yourTableView.layer.masksToBounds = TRUE;
yourTableView.layer.cornerRadius = 10.0f; // as per you requirement please give this value.
you can take any number of rows. but table corners remains as it is.
I think this will help you....

Using "tableView didSelectRowAtIndexPath" in tandem with prepareForSegue

I have a project utilizing storyboards that uses UITableView in tandem with a Navigation Controller. Its layout is similar to apple's iOS Address Book where there is a table of objects, and clicking on a cell pushes a view onto the navcontroller with that objects's details (properties). I am having trouble using the prepareForSegue method in harmony with the table view's didSelectRowAtIndex. I need a way for the prepareForSegue to know about the row passed in didSelectRowAtIndex so i can pass it's properties to the detail view controller being pushed since prepareForSegue gets called before didSelectRowAtIndex does. If possible I would still like to use the storyboard segue but if there isn't a way i can progamatically push/pop. There is another question similar to this on stackoverflow but it never really was answered, it kind of just rambled on.
If you know a work-around please let me know, thank you!
You can not use didSelectRowAtIndexPath: at all. You can get the index path in prepareForSegue: like this:
UITableViewCell *cell = (UITableViewCell*) sender;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];

UITableViewCell - Missing the MOVE lines in Edit Mode

I'm flummoxed as to what I may have done to cause this, but it seems that the lines that represent (and allow) MOVING of a UITableViewCell have disappeared when I enter edit mode. The delete button is there.
Anyone know what method or methods control that (usually default) cell accessory from being displayed when a user enters edit mode?
Thanks!
Turns out I was missing this method:
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath{
}
Thank you, Git!

How do i add UITableView in the UITableView cell?

I Have one tableview(First) in that i want another tableview(Second) in the cell of first tableView.
In short i want each cell contains one more tableview.
So help me out with this problem.
Thanks in advance.
Although I think the below method is better this tutorial shows you how to create a tableView inside of another tableView http://iosstuff.wordpress.com/2011/06/29/adding-a-uitableview-inside-a-uitableviewcell/
My Solution:
That approach is bound to run into serious problems, so I suggest scrapping it. If you have nested table views (or scroll views, more generally) then the scrolling behavior of the views will be erratic. A better solution is to use variable height table view cells: you just create the cell view to hold all the multiple choice options you need, and implement
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
in your table view delegate to supply the heights of the cells.

swipe to delete when already in edit mode

I have an iphone app using a uitableview where I'd like the "reorder" controls to always be displayed, and have the user swipe to delete rows.
The approach I'm currently taking is to put the tableview in edit mode and allow selection in edit mode
self.tableView.editing = YES;
self.tableView.allowsSelectionDuringEditing = YES;
I then hide the red delete circles using
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleNone;
}
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
{
return NO;
}
I cant figure out how to get the swipe gesture to bring up the "delete" on the right side when the tableview is already in edit mode, can somebody point me in the right direction?
alternatively, if someone knows how to get the cell reordering controls to show when NOT in edit mode, that would also be a workable solution
cheers
When the user swipes on a given row, you need to store a reference somewhere so that you can change the value returned by editingStyleForRowAtIndexPath and shouldIndentWhileEditingRowAtIndexPath. Your best bet is likely to use indexPathForCell on the cell that is swiped and store that. Then in the two display methods above you need to check if the NSIndexPath is the same or not (I'm not sure if they will be the same pointer or if you'll need to compare the section/row values - testing required). If they match, display the delete button.
Note that you may need to call reloadData on your tableView to have the effect appear without scrolling away and back again.
I'm wondering if the way you're headed now would break the Human Interface guidelines, which would result in the app not getting approved.
I can't see why you can't capture the swipe gesture and then use that to 'unhide' the red delete (stop sign) icons for the delete confirmation?