
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 1.20 KB | hits: 49 | expires: Never
pushViewController and popToRootViewController
[navigationController pushViewController:_viewController animated:YES];
UIButton* backButton = [UIButton buttonWithType:101];
[backButton addTarget:self action:@selector(dismissView:) forControlEvents:UIControlEventTouchUpInside];
[backButton setTitle:@"Done" forState:UIControlStateNormal];
UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
self.navigationItem.leftBarButtonItem = backItem;
[backItem release];
-(void) dismissView: (id)sender
{
[self.navigationController popToRootViewControllerAnimated:YES];
//[self.navigationController popToViewController:_viewController animated:YES];
}
-(void) dismissView: (id)sender
{
NSLog(@"Hii....");
[self.navigationController popToRootViewControllerAnimated:YES];
//[self.navigationController popToViewController:_viewController animated:YES];
}
UIButton* backButton = [UIButton buttonWithType:101];
+ (id)buttonWithType:(UIButtonType)buttonType
typedef enum {
UIButtonTypeCustom = 0,
UIButtonTypeRoundedRect,
UIButtonTypeDetailDisclosure,
UIButtonTypeInfoLight,
UIButtonTypeInfoDark,
UIButtonTypeContactAdd,
} UIButtonType;