views:

789

answers:

3

I want my table items to show the disclosure arrow and link to another "details" screen. Pretty standard. Three20 is supposed to help with this.

In my TTListDataSource, I'm currently doing:

- (void)tableViewDidLoadModel:(UITableView *)tableView
{
    [super tableViewDidLoadModel:tableView];

    // Construct an object that is suitable for the table view system
    // from each domain object that we retrieve from the TTModel.
    for (Listing *result in [(id<SearchResultsModel>)self.model results]) {          
     NSString *url = [NSString stringWithFormat:@"myapp://listing", result.theID];     
     TTTableSubtitleItem *item = [TTTableSubtitleItem itemWithText:result.title subtitle:result.desc imageURL:result.imageURL defaultImage:nil URL:url accessoryURL:nil];
     [self.items addObject: item];
    }
}

But I need to pass an object (not just a string) to the TTViewController when the TTTableItem is clicked. I know that you can pass an NSDictionary object to a TTViewController using: TTNavigator's [[TTNavigator navigator] openURL: query: animated:] method.

However, since I'm trying to open this URL from a TTTableItem, I don't know how to use openURL method with it where I can pass a query NSDictionary object, since all it takes as an NSString "URL" parameter.

I read the discussion here however I'd really, really like to avoid having to modify the original Three20 code. If it can properly be extended, that would be fine.

What's the simplest way I can make my table item's open up a TTViewController and pass an object (such as an NSDictionary)?

+1  A: 

From the Google Group... http://groups.google.com/group/three20/msg/5cdbbaf753dc52a1

philfreo
+3  A: 

If you look at http://three20.info/core/navigation they show you how to do this without overriding the didSelectObject method.

In a nutshell, you can assign a URL to an object (via a category for NSObject) which is mapped to a URL for the controller that is hosting the table. The handler can then open another URL passing the appropriate objects in the query dictionary.

lyonanderson
A: 

How to do this on a TableItem?

I dont know how to call didSelectRowAtIndexPath in my DataSource.

fabian
The answer section is not a place for additional questions.
coneybeare