views:

49

answers:

1

I am trying to pass in a URL as a parameter to a TTURLMap like this:

[map from@"tt://person/(initWithURL:)" toViewController: [PersonViewController class]];

I then have a TTStyledTableItemCell with links that render like this:

<a href="tt://person/http://persons.url.com/blah"&gt;Person name</a>

but when I click on these links the link doesn't call the initWithURL: method in the PersonViewConroller class. I've verified things are wired up correctly by passing in a simple string. I believe this isn't working because the parser thinks the URL is part of the TTURLMap url mapping. Is there a way to escape the person's feed url (its a rest service that i need to use to pull info in)?

many thanks in advance.

+2  A: 

This is a common problem. I haven't found an elegant solution; the best I've been able to find is to manually escape the URL on the way in (e.g. by Base64-encoding it), and then manually unescape it inside your initWithURL: function. (Actually, you'd probably want to have a function called initWithBase64EncodedURL: or something like that, for clarity.)

Mike Morearty