2014/10/31

Table’s cell is not selected in Swift

I have been studying Swift language a little every day. And I found my table view did not work as I expected.
When you tap one cell, delegate method “tableView:didSelectRowAtIndexPath:” should be called, right?
But my swift table did not work like that.
When I tapped one cell, nothing happened.
Next I tapped another cell, the delegate method called but the selected cell was the one I tapped first.

This is really strange result. I’ve never seen this kind of action in Objective-C.
I thought this might be a problem of Swift…
prinfln() does not work or I misuse this?
I made cells wrongly?
or how to initialize view controller is wrong?

I was not able to find the answer for a few days but finally I found it here :

JamesonQuave.com • View topic - Part 4 - didDeselectRowAtIndexPath

This is the same action!

I found the delegate method was wrong!
tableView:didDeselectRowAtIndexPath:
↑Oh, I did not know this delegate method existed!

Right one is here :
tableView:didSelectRowAtIndexPath:
Develop | Comments(0) | Trackback(0)
Comment

管理者のみに表示