想通了我自己,对于那些谁需要它:
第一(通过在导航地图 “subURLs”)
导航到一个URL与@“TT://照片/ firstphoto像这样的“是可能的,你可以得到一个 ”firstphoto“:
//Prepare your Navigator Map like this
[map from:@"tt://photos/(initWithNumber:)" toViewController:[PhotoVC class]];
在你PhotoVC你可以访问此号码:
-(void) initWithNumber: (NSString*)number {
NSLog(@"%@",number);
}
调用这个网址您的视图控制器看起来:
PhotoVC* controller = [[PhotoVC alloc] initWithNumber:@"1"];
[navigationController pushViewController:controller animated:YES];
[controller release];
二(传递一个TTTableViewController对象)
它有点棘手,但你不要有任何类继承。
第一,零在你TTTableViewController的表项
[TTTableLink itemWithText:@"TTTableLink" URL:nil]
的URL写下这个方法
- (void)didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath {
TTURLAction *urlAction = [[[TTURLAction alloc] initWithURLPath:@"tt://photos"] autorelease];
urlAction.query = [NSDictionary dictionaryWithObject:@"firstphoto" forKey:@"photo"];
urlAction.animated = YES;
[[TTNavigator navigator] openURLAction:urlAction];
}
现在在你的PhotoVC你需要像这样
- (id)initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query {
if (self = [super init]) {
NSLog(@"%@",query);
}
return self;
}
你完成了;)
感谢这个! – 2010-12-31 08:36:41
太棒了!我没有在'[TTTableLink itemWithText:@“TTTableLink”URL:nil''中传递nil''。这很愚蠢,你必须这样做,因为现在我必须手动告诉单元显示正确的箭头。 – 2011-05-17 19:03:52
Choise,你可以按照预期使用URL。看到我对你问题的回答。我已将您的代码更改为符合TTNavigator。 – Fa11enAngel 2012-08-16 19:13:37