i have application view with nine icons on each page, i want to call a function when a certain icon is pressed for certain amount of time. similarly i want to do this with a cell in UITableView.
You can enable NSTimer on touchesBegan:withEvent and disable it on touchesEnded:withEvent.
For the icons view have used the TouchDown and TouchUpInside event to acomplish,
Used timeBetweenTouchRelease = [[NSDate date] timeIntervalSince1970]; when TouchDown
and Used the following timeBetweenTouchRelease = [[NSDate date] timeIntervalSince1970] - timeBetweenTouchRelease;
when TouchUpInside.
Still having problem with tablecell, i guess when using touch begin and end user may move his finger so that means user may have moved from one cell to another.
The button is easier because of the TouchUpInside and TouchDown events you can react to.
For a cell, you'd probably have to start a timer in setHighlighted:, and disable the timer when setHighlighted was called to unhighlight.