Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-22-2010, 05:07 AM   #326 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 5
Default

Did you able to use a separate initial view except from the one when Tabitem selected?
I am looking for such an solution.
settings tabBarController.tabBar.selectedItem = nil;
throw an error,
'Directly modifying a tab bar managed by a tab bar controller is not allowed.'
ashrafulkarim is offline   Reply With Quote
Old 04-22-2010, 05:16 AM   #327 (permalink)
iPhone Developer
 
Join Date: Jan 2009
Location: India , Pune
Posts: 44
Send a message via Skype™ to ameya
Thumbs up

Plz add the TabeleView Delegate and Table View Data source in the header file and implement the standard protocol method , in the didSelect method add code to load ur Detail View. Plz refer iPhone samples TableViewSuit .

Quote:
Originally Posted by ujagtap View Post
Hi everybody,

I have developed following application,

1. Took UITabBarController and UINavigationController in first tab.
2. In first navigation controller i took UISegmentedControl.
3. On segment selection i am changing views.
4. On first segment i am showing UITableView and on second segment i am showing UIImageView.
5. If i select any row from UITableView i want to display details for that row, by calling another ViewController.

But on selection of table cell it is not going ahead.

Please see attached sample code.
In DetailViewController i am calling showDetails() and in that function i am calling pushViewController for SecondTableView but it is not working. Please help.
__________________
Sr Software Programmer

Solutions to problems
ameya is offline   Reply With Quote
Old 04-29-2010, 02:08 AM   #328 (permalink)
Umesh Jagtap
 
ujagtap's Avatar
 
Join Date: Sep 2009
Location: Pune, India
Posts: 35
Default

Thanks Ameya!! i did the same and it is working fine.
ujagtap is offline   Reply With Quote
Old 05-19-2010, 12:43 PM   #329 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 3
Default Same Problem

I have been searching for a way to combine all three for almost 2 weeks now and have gotten nowhere. I see that you had a solution to the problem. Is it possible to let me know how to do it. I have been able to get all 3 together only to lose the ability to select the rows. Please help.
ggenova is offline   Reply With Quote
Old 05-20-2010, 08:47 AM   #330 (permalink)
- U haz disappoint -
 
Join Date: Jan 2010
Location: Belgium
Posts: 487
Send a message via MSN to jNoxx Send a message via Skype™ to jNoxx
Default

Ok guys, the easiest way to be honest, and u wont have any troubles anymore, is to Follow O'reilly youtube channel..
atm, im at this
YouTube - Building an iPhone App Part II

But if u look in description of that video, and starts the previous tutorial of that, it has all 3 u guys requested in 1, and works perfectly
Good luck
jNoxx is offline   Reply With Quote
Old 09-06-2010, 06:10 PM   #331 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 3
Default Initializing TabBarItem title and image

Hi there,

This is a great thread. Thanks to all for participating. What is the proper location for setting the title and image for a Table View Controller that is part of a Nav Controller that is part of a Tab Bar Controller?

Tab Bar Controller
--------Nav Controller
--------------Table View Controller
--------Nav Controller
--------------Table View Controller
--------Custom View Controller

I set the tabBarItem.title and tabBarItem.image in the init method of Custom View Controller and that works just fine. But when I override init for TableViewController and set title and image for tabBarItem for the Nav Controller-TableViewController tabs the corresponding label and image do not appear in the tab. I am not sure what is the proper place to set the tab bar item for this scenario. I am doing this programmatically. Thank you.
nixesmixes is offline   Reply With Quote
Old 09-20-2010, 11:44 AM   #332 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 5
Default Having a Login page before the NavBar-TableView-TabBar nib

Quote:
Originally Posted by DevTeamOfOne View Post
Code:
@interface AppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    UITabBarController *tabBarController;
    MyTableViewController *myTableViewController;
    MySecondTableViewController *mySecondTableViewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UITabBarController *tabBarController;
@property (nonatomic, retain) MyTableViewController *myTableViewController;
@property (nonatomic, retain) MySecondTableViewController *mySecondTableViewController;

@end




@implementation AppDelegate

@synthesize window, myTableViewController, mySecondTableViewController, tabBarController;

- (void)applicationDidFinishLaunching:(UIApplication *)application {

       tabBarController = [[UITabBarController alloc] init];          // creates your tab bar so you can add everything else to it

       myTableViewController = [[MyTableViewController alloc] init];               // creates your table view - this should be a UIViewController with a table view in it, or UITableViewController
       UINavigationController *tableNavController = [[[UINavigationController alloc] initWithRootViewController:myTableViewController] autorelease];
       [myTableViewController release];                                                              // creates your table view's navigation controller, then adds the view controller you made. Note I then let go of the view controller as the navigation controller now holds onto it for me. This saves memory.

       mySecondTableViewController = [[MySecondTableViewController alloc] init];   
       UINavigationController *table2NavController = [[[UINavigationController alloc] initWithRootViewController:mySecondTableViewController] autorelease];
       [mySecondTableViewController release];                                                    // does exactly the same as the first round, but for your second tab at the bottom of the bar.

       tabBarController.viewControllers = [NSArray arrayWithObjects:tableNavController, table2NavController, nil]; add both of your navigation controllers to the tab bar. You can put as many controllers on as you like, but they will turn into the more button like in the iPod program.

       [window addSubview:tabBarController.view];                                              // adds the tab bar's view property to the window
       [window makeKeyAndVisible];                                                                  // makes the window visible
}

- (void)dealloc {
       [tabBarController release];
       [window release];
       [super dealloc];
}                                           // lets go of everything else, thats so your program doesn't create any leaks of memory.

@end

I just typed up this quick App Delegate to show you how to do it. Yes, you do have rights to use whatever part of it you wish, and yes, you can ask any questions you like.

Please do note:
a ) I release the table views because they have been retained by the Navigation Controllers. Thus, I have doubled up and am taking double the memory. Once you have a nav controller holding your view, drop it. This saves memory. These nav controllers are set to drop automattically with their autorelease so there is no leak issue.

b ) if you need to add only one item to your tabBar for some strange reason, or just to test, change "arrayWithObjects: blah, blah2, nil" to "arrayWithObject: blah" and drop the nil.

Does this help you???

Hi Dev & Others,

If I have to first display an Login view and then show the NavigationController-TableView-TabBarController view to the user, how can I achieve it. The above code works without showing the Login page, but I want to have the login page and validate before showing the Tab bar.

I tried creating an LoginViewController and call it from the MainWindow.xib. From the login view's button clicked action, I pushed the Tabbar view controller. However, I couldn't succeed on it.

Thanks in advance for your suggestions.
-Ela
idesiteacher is offline   Reply With Quote
Old 09-20-2010, 01:39 PM   #333 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 5
Default Application Error

I tried the suggested steps (used the IB, instead of direct coding) and created an application with an login view and navcontroller-tableview-tabbarcontroller page.

The application closes (without any error displayed in the console window) abruptly, on the following sequence.
- run the app
- click the login button (no entries required)
- in the "Seller" tab bar page, click on any one of the table row. It would navigate to the "Vehicle Info" page.
- click on the back navigation button "Seller Vehicles"
- Application crashes

I spent days analyzing the issue but couldn't succeed. If someone can run the app, analyze the code and let me know what's wrong, it would be great.

Thanks
Ela
Attached Files
File Type: zip iDealers.zip (68.2 KB, 180 views)
idesiteacher is offline   Reply With Quote
Old 09-20-2010, 11:29 PM   #334 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 5
Default Problem solved

Quote:
Originally Posted by idesiteacher View Post
I tried the suggested steps (used the IB, instead of direct coding) and created an application with an login view and navcontroller-tableview-tabbarcontroller page.

The application closes (without any error displayed in the console window) abruptly, on the following sequence.
- run the app
- click the login button (no entries required)
- in the "Seller" tab bar page, click on any one of the table row. It would navigate to the "Vehicle Info" page.
- click on the back navigation button "Seller Vehicles"
- Application crashes

I spent days analyzing the issue but couldn't succeed. If someone can run the app, analyze the code and let me know what's wrong, it would be great.

Thanks
Ela
This problem is now solved. It was something to do with memory management, which I had handled wrongly.

Thanks
Ela
idesiteacher is offline   Reply With Quote
Old 09-25-2010, 12:33 AM   #335 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 193
Exclamation Tabbar nav tableview controllers

Nevermind, i did it using the appDelegate...i just dont understand why Apple says not to use singletons like the UIApplication sharedApplication if sometimes its the only way to get things to work...or is there any other way to make this work?

How do u program the tableviewcontroller to push the next VC from the didselectrowatindexpath since the navcontroller is declared in the app delegate so u can't write self.navcontroller push.....?


Quote:
Originally Posted by BostonMerlin View Post
Thanks Dev. I was able to get that code running with one tab showing a UINavigationController and a table full of data and the other tab showing a UIViewController with a page of labels and buttons. Very nice.. thank you!

I am hitting a wall though. Using your code i've tried any number of ways to add content below the nav bar but above the tableview. I'm trying to get the following look for this app....


Pseudo Description:
- App should have a tabbar at the bottom with two tabs
- the first tab shows a navigationcontroller up top, label and image below it followed by a tableview.
- the second tab shows labels and images.

For whatever reason the tabbar is the big pain! I know this isnt rocket science.. it's just not clicking. I can perform these tasks w/out the tab bar but throw that into the mix and i'm getting nothing but a white page on that first tab.


Thanks Again
JB








Any thoughts? Thanks again for your help.
John
__________________
Mars
www.santiapps.com
www.gea-hn.com
mba-i4

Last edited by marciokoko; 09-25-2010 at 12:45 AM.
marciokoko is offline   Reply With Quote
Old 11-23-2010, 01:01 AM   #336 (permalink)
Registered Member
 
Join Date: Nov 2010
Posts: 1
Default Please Help Me

Hello every One,

My english is not good.. so sorry all that..

I am very new into iphone application development,
I am trying to create an application
1- Loging view
2 after login go to a navigation based application with tableview and tabbar at bottom.
3- when i pushview at table row then goto again to a tableview and again select a row then go to a detail view , that detail view have diffrent tabbar . and when i click those tab show diffrent view with same navigation bar .
mukeshots is offline   Reply With Quote
Old 04-10-2011, 09:31 AM   #337 (permalink)
Registered Member
 
Join Date: Apr 2011
Posts: 3
Default

See this example, in More tabbar controller, already created tableview, but how the delegate call ? code inside appdelegate.m ? or where ?

Quote:
Originally Posted by Brix View Post
Have a check of which row was clicked. For example if,

TableView
Row 1 - Book1
Row 2 - Book2
Row 3 - Book3

Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if( indexPath.row == 1 )
{
	 Book1 *xBook1 = [[Book1 alloc] initWithNibName:@"Book1" bundle:nil];
	 [self.navigationController pushViewController:xBook1 animated:YES];
	 [xBook1 release];
}
else if( indexPath.row == 2 )
{
	 Book2 *xBook2 = [[Book2 alloc] initWithNibName:@"Book2" bundle:nil];
	 [self.navigationController pushViewController:xBook2 animated:YES];
	 [xBook2 release];
}
else if( indexPath.row == 3 )
{
	 Book3 *xBook3 = [[Book3 alloc] initWithNibName:@"Book3" bundle:nil];
	 [self.navigationController pushViewController:xBook3 animated:YES];
	 [xBook3 release];
}
}
This is the concept.
maengkom is offline   Reply With Quote
Old 12-02-2011, 01:31 AM   #338 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 1
Smile creating a tabbar and navigation bar programmatically

Quote:
Originally Posted by DevTeamOfOne View Post
Code:
@interface AppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    UITabBarController *tabBarController;
    MyTableViewController *myTableViewController;
    MySecondTableViewController *mySecondTableViewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UITabBarController *tabBarController;
@property (nonatomic, retain) MyTableViewController *myTableViewController;
@property (nonatomic, retain) MySecondTableViewController *mySecondTableViewController;

@end




@implementation AppDelegate

@synthesize window, myTableViewController, mySecondTableViewController, tabBarController;

- (void)applicationDidFinishLaunching:(UIApplication *)application {

       tabBarController = [[UITabBarController alloc] init];          // creates your tab bar so you can add everything else to it

       myTableViewController = [[MyTableViewController alloc] init];               // creates your table view - this should be a UIViewController with a table view in it, or UITableViewController
       UINavigationController *tableNavController = [[[UINavigationController alloc] initWithRootViewController:myTableViewController] autorelease];
       [myTableViewController release];                                                              // creates your table view's navigation controller, then adds the view controller you made. Note I then let go of the view controller as the navigation controller now holds onto it for me. This saves memory.

       mySecondTableViewController = [[MySecondTableViewController alloc] init];   
       UINavigationController *table2NavController = [[[UINavigationController alloc] initWithRootViewController:mySecondTableViewController] autorelease];
       [mySecondTableViewController release];                                                    // does exactly the same as the first round, but for your second tab at the bottom of the bar.

       tabBarController.viewControllers = [NSArray arrayWithObjects:tableNavController, table2NavController, nil]; add both of your navigation controllers to the tab bar. You can put as many controllers on as you like, but they will turn into the more button like in the iPod program.

       [window addSubview:tabBarController.view];                                              // adds the tab bar's view property to the window
       [window makeKeyAndVisible];                                                                  // makes the window visible
}

- (void)dealloc {
       [tabBarController release];
       [window release];
       [super dealloc];
}                                           // lets go of everything else, thats so your program doesn't create any leaks of memory.

@end

I just typed up this quick App Delegate to show you how to do it. Yes, you do have rights to use whatever part of it you wish, and yes, you can ask any questions you like.

Please do note:
a ) I release the table views because they have been retained by the Navigation Controllers. Thus, I have doubled up and am taking double the memory. Once you have a nav controller holding your view, drop it. This saves memory. These nav controllers are set to drop automattically with their autorelease so there is no leak issue.

b ) if you need to add only one item to your tabBar for some strange reason, or just to test, change "arrayWithObjects: blah, blah2, nil" to "arrayWithObject: blah" and drop the nil.

Does this help you???

I am a beginner i want the full code to implement the things which you have shared . please help me out.
sourabhs is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 252
19 members and 233 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, Dani77, DarkAn, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, MACralik, NSeven, prchn4christ, Rudy
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:52 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0