私はチュートリアルhereに従っていました。URLにネイティブオブジェクトを渡します
私が持っているコードは次のとおりです。
- (void) didSelectObject:(id) object atIndexPath:(NSIndexPath*) indexPath
{
Group * group = (Group *)((RKMappableObjectTableItem *) object).object;
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
group.unread = 0;
[self.tableView reloadData];
TTURLAction *action = [[[TTURLAction actionWithURLPath:@"tt://group"]
applyQuery:[NSDictionary dictionaryWithObject:group forKey:@"kParameterUser"]]
applyAnimated:YES];
[[TTNavigator navigator] openURLAction:action];
}
私のようにマッピングを設定している:
[map from:@"tt://group" toSharedViewController:[TopicsViewController class]];
と私TopicsViewControllerの内側に、私が試してみました両方:
- (id) initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query {
をしかし、それはdidnの仕事はありません。まるでマッピングが見つからないかのようです。どうしてこれなの?私は間違って何をしていますか?
UPDATE:
TTURLAction *action = [[[TTURLAction actionWithURLPath:@"tt://group"]
applyQuery:[NSDictionary dictionaryWithObject:group forKey:@"kParameterUser"]]
applyAnimated:YES];
[[TTNavigator navigator] openURLAction:action];
[map from:@"tt://group?" toSharedViewController:[TopicsViewController class] selector:@selector(initWithNavigationURL:)];
- (id) initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query
私がここで間違って何をやっている:?
ここでの提案に基づいて更新されたコードですか
私は実際にはinitWithNavigatorURLを呼び出すだけです:(NSURL *)URLクエリ:(NSDictionary *)クエリ、別のセレクタの代わりに...いくつかの他の例を見て、それを使用していないようですか? ..あなたは精巧にできますか?私は上記の質問にリンクされている3つの文書でさえ、それは使用されていませんでしたか? – adit
なぜあなたのinitメソッドでnavigatorURLが気になりますか?なぜあなたはそれが必要なのですか?どちらの方法でも、セレクタを@selector(initWithNavigatorURL :)に設定します。 – coneybeare
私は実際にnavigatorURLを気にしません。渡されたオブジェクトが気になります。とにかく私はあなたの提案を試みましたが、それでも動作しません... – adit