Hey guys...
I'm stuck trying to pop a TTPhotoViewController from three20. At first it did not come with a back button, but I have now implemented it and tried to pop the view with no luck. Here's a snippet of my code:
Button (this works) --
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:TTLocalizedString(@"Back", @"Back to Albums") style:UIBarButtonItemStyleBordered target:self action:@selector(popView)];
-popView (method is called, but statement does NOT work) --
- (void) popView {
[self.navigationController popViewControllerAnimated:NO];
}
thanks
UPDATE 0 -
This is the code that ttphotoviewcontroller had in its init (I checked that the program was running this) --
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
self.navigationItem.backBarButtonItem =
[[[UIBarButtonItem alloc]
initWithTitle:
TTLocalizedString(@"Photo",
@"Title for back button that returns to photo browser")
style: UIBarButtonItemStylePlain
target: nil
action: nil] autorelease];
self.statusBarStyle = UIStatusBarStyleBlackTranslucent;
self.navigationBarStyle = UIBarStyleBlackTranslucent;
self.navigationBarTintColor = nil;
self.wantsFullScreenLayout = YES;
self.hidesBottomBarWhenPushed = YES;
self.defaultImage = TTIMAGE(@"bundle://Three20.bundle/images/photoDefault.png");
}
return self;
}
It was already adding a back button, but alas this code also doesn't add a button to my navbar.