I have an issue with NSObjects to URLs mapping.
I followed the documentation and I get that :
[map from:[Foo class] name:@"foo" toURL:@"tt://detailedfoo/foo/(fooId)"];
[map from:@"tt://detailedfoo/foo/(initWithFoo:)" toSharedViewController:[DetailedFooController class]];
for (Foo* foo in foos)
{
[items addObject:[TableFooItem itemWithTitle:nil
caption:foo.title
text:foo.text
URL:[foo URLValueWithName:@"foo"]]];
}
When my controller pushed, the “initWithFoo” method called but the Foo object belongs to NSCFString class and not Foo class.
If anyone has an idea, I take it !
Thx.
You need to use the same name between the URL map and your invocation of URLValueWithName:. In this case:
This will check the url map, find the
@"foo"name in the map, and then create the following url path for a Foo object withfooId = 3: