0

I am able to fetch list of data from a restful web service. The goal is to display the same in the form of rows in iPhone application.

I could able to bring up the table with data while rendering the view. But I could not able to scroll down to see all the result.

Do I need to implement any method in the View Controller?

Also I am able to add detail disclosure button for each row. For touchdown action on the disclosure button, which method do i need to implement in View Controller?

Ref: http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/c/econst/UITableViewCellAccessoryDetailDisclosureButton

Please suggest.

EDITED :

Here is the code snippet how am adding UI button in a row:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {

    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

}

2 Answers 2

0

It sounds like you are loading the data from a web service synchronously, so the UI thread will be blocked until it is done, and you will not be able to scroll the table view. Use NSOperationQueue and NSOperation, GCD, NSURLConnection and a delegate, or a library like AFNetworking to load data asynchronously.

As for the disclosure button, see the docs for UITableViewDelegate. Specifically, you are interested in -tableView:accessoryButtonTappedForRowWithIndexPath:.

1
  • I did implement that method (accessoryButtonTappedForRowWithIndexPath) in my controller, but on click control is not coming to that method while debuting. Any clue what am missing here? Do we need to pass any id to id while adding button?
    – Kodaganti
    Commented Jun 12, 2013 at 20:02
0

You need this:

[tableView beginUpdates];
[tableView insertRowsAtIndexPaths:*arrayOfIndexPaths* withRowAnimation:*rowAnimation*];
[tableView endUpdates];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.