проблема в том что я не могу в внутри конкретного таба достучаться до navigation view чтобы убрать back button или же изменить title .
- (void)applicationDidFinishLaunching:(UIApplication *)application {
navigationController = [[UINavigationController alloc] init];
WelcomeViewController *viewController = [[WelcomeViewController alloc] initWithNibName:@"WelcomeView" bundle:nil];
[navigationController pushViewController:viewController animated:NO];
[viewController release];
[window addSubview:navigationController.view];
// Override point for customization after application launch
[window makeKeyAndVisible];
}
- (IBAction)signIn:(id)sender
{
LogInController *viewController = [[LogInController alloc] initWithNibName:@"LogInView" bundle:nil];
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}
- (IBAction)doLogIn {
TabBarController *viewController = [[TabBarController alloc] init];
[self.navigationController pushViewController:viewController animated:YES];
[viewController release];
}
- (void)viewDidLoad {
TabBarOneController *placeholder1 = [[[TabBarOneController alloc] initWithTitle:@"One"] autorelease];
TabBarTwoController *placeholder2 = [[[TabBarTwoController alloc] initWithTitle:@"Two"] autorelease];
TabBarThreeController *placeholder3 = [[[TabBarThreeController alloc] initWithTitle:@"Three"] autorelease];
TabBarFourController *placeholder4 = [[[TabBarFourController alloc] initWithTitle:@"Four"] autorelease];
tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:placeholder1, placeholder2, placeholder3, placeholder4, nil];
[placeholder1 release];
[placeholder2 release];
[placeholder3 release];
[placeholder4 release];
[self.view addSubview:tabBarController.view];
[super viewDidLoad];
}
- (id)initWithTitle:(NSString*)theTitle {
if (self = [super init]) {
self.tabBarItem.image = [UIImage imageNamed:@"table.png"];
self.title = theTitle;
}
return self;
}
- (IBAction)getFromCameraRoll:(id)sender
{
[self presentModalViewController:[[ImagePickerController alloc] init] animated:YES];
}
[self.navigationController pushViewController:viewController animated:YES];
[self presentModalViewController:viewController animated:YES];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if( theConnection ) {
webData = [[NSMutableData data] retain];
}
else {
NSLog(@"theConnection is NULL");
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [data count];
}
В методах делегата NSURLConnection есть метод, который вызывается в конце загрузки страницы. Определи этот метод и напиши в нем [self.tableView reloadData];.Подскажите пожалуйста как можно запустить это чтобы сначала приходили данные, а потом их можно было отправлять в tableView ?
@interface TabBarViewController : UIViewController {
UITabBarController *tabBarController;
}
@property(nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@end
@implementation TabBarViewController
@synthesize tabBarController;
- (void)dealloc {
[tabBarController release];
[super dealloc];
}
@end
2009-09-28 19:22:38.913 CZ[6035:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "TabBarViewController" nib but the view outlet was not set.'
то нижние табы растягиваются на весь экран вертикально.Files Owner
First Responder
Tab Bar Controller
--Tab Bar
--New Tab Bar View Controller
----Tab Bar Item (New)
--.....
---.....
[self.view addSubview:tabBarController.view];
self.navigationItem.title = @"Some Title";
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetalCardViewController *detailController = [[DetalCardViewController alloc] initWithNibName:@"DetalCardView" bundle:nil];
[self.navigationController pushViewController:detailController animated:YES];
}