I'm using a modified View-Based Application, where I have starting UIViewController showing a input control & a TTThumbsViewController showing the results. I'm passing them in the AppDelegate using TTNavigator initWithName:
for the TTThumbsViewController.
I did this by myself reading from the documentation:
The ViewDidLoad method inside my TTThumbsViewController:
- (void)viewDidLoad {
self.photoSource = [[PhotoSource alloc]
initWithType:PhotoSourceNormal
title:myTitle
photos:myImages
photos2:nil
];
}
The implementation of my AppDelegate:
@implementation geoFlickrAppDelegate
@synthesize window=_window;
@synthesize viewController=_viewController;
@synthesize navigator;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
navigator =[TTNavigator navigator];
navigator.window = self.window;
TTURLMap *map = navigator.URLMap;
[map from:@"app://home/" toViewController:[geoFlickrViewController class]];
[map from:@"app://album/(initWithName:)" toViewController:[AlbumController class]];
[navigator openURLAction:[TTURLAction actionWithURLPath:@"app://home/"]];
// Override point for customization after application launch.
[self.window makeKeyAndVisible];
return YES;
}
-(void)toGallery:(NSString*)txt
{
[navigator openURLAction:[TTURLAction actionWithURLPath:txt]];
}
The event inside my UIViewController for pushing the next view:
-(IBAction)search:(id)sender
{
NSString *str = [[NSString alloc] initWithFormat:@"app://album/%@",txtSearch.text];
geoFlickrAppDelegate *appDelegate = (geoFlickrAppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate toGallery:str];
}
The result from this code is that the input is passed through my AppDelegate in the TTThumbsViewController using initWithName:
but the never gets pushed in & my ViewDidLoad
method never gets called. Any idea why is that so?