As I understand it, once we get to 64-bit land, variable storage is created at run-time vs. being set up at compile-time. That means those ivars can eventually go bye-bye! Apple may be advocating IBOutlet on property declarations now in anticipation of that. (Intrepid readers: Please confirm if I'm on the right track here!)
As I understand it, once we get to 64-bit land, variable storage is created at run-time vs. being set up at compile-time. That means those ivars can eventually go bye-bye! Apple may be advocating IBOutlet on property declarations now in anticipation of that.
if I nod wisely can I convince you that I understand that (please don't spend any more time elaborating on that - I will come back to you on that in a year or so...)
one final (i promise) question - and this is really quick:
alright so it is not over... this is slowly migrating away from the topic i suppose, but it is still the same project and I suspect it is related to not using IB... so I guess it is part of the overall theme of this thread... anyway...
I have tried to implement an UIWebView to display instructions.html. The code loads without warnings or errors but the webview remains blank... I am sure it is something simple. If you could help me out I would be grateful.
if ([[[myTableView cellForRowAtIndexPath:indexPath] textLabel] isEqual:@"Case 1"])
Use [myTableView cellForRowAtIndexPath:indexPath].textLabel.text
That gives you the equivalent of cell.textLabel.text from earlier.
(What happened: Apple tidied these bits up in 3.0, so textLabel is now available as an honest-to-goodness UILabel object. That means you now get to ascribe whatever changes you want to it, vs. just setting the text.)
Is it possible to create a tab-bar based application which will be like this,ie,
When the application loads it will be showing a view with some general details, and then when we click on each tab(3tabs), a different view is shown.
OR
A normal view based application with a tab-bar, which will be like i said earlier, having 3 different views for the 3 tabs other than the normal view??
I have been trying to develop one like this 4m ydy,but facing a lot of problems. Can you help me out,please?
Is it possible to create a tab-bar based application which will be like this,ie,
When the application loads it will be showing a view with some general details, and then when we click on each tab(3tabs), a different view is shown.
OR
A normal view based application with a tab-bar, which will be like i said earlier, having 3 different views for the 3 tabs other than the normal view??
I have been trying to develop one like this 4m ydy,but facing a lot of problems. Can you help me out,please?
It sounds like you want to make a tab bar application, but with a different initial view than you would normally see by picking any of the tabs, like a splash view that only gets shown one time. Is that the idea?
The first video shows a few different apps, so I'm not sure which one you're referring to. Is there a specific app you've seen that does what you're looking for? That will help clarify with a concrete example.
It sounds like you want to make a tab bar application, but with a different initial view than you would normally see by picking any of the tabs, like a splash view that only gets shown one time. Is that the idea?
The first video shows a few different apps, so I'm not sure which one you're referring to. Is there a specific app you've seen that does what you're looking for? That will help clarify with a concrete example.
Actually the application that i meant is iExpenselt. In that app, when it loads it shows a main view. And a tab-bar. When we click on any tab of the tab-bar it navigates(yes, not like normal tab-views) to a different view, with the name of the main view on the left top. When we click on it, we gets the main view. And 4 each tab, this provision is available.
If you just look at any video of iExpenselt app, u can see that.
I want to know how they did it. Plz help,thanks for ur reply.
In (iExpenselt), when it loads it shows a main view. And a tab-bar. When we click on any tab of the tab-bar it navigates(yes, not like normal tab-views) to a different view, with the name of the main view on the left top.
Ahh, I see.
Disclaimer: Not owning iExpenseIt, I'm not sure what the actual, complete animation effect and user experience is. (Sometimes they edit things in the ads.) Still, let's see if I can draw a bead on this.
So, two things I notice. First, there's no tab selection - no telltale blue highlight. The initial view is some kind of "home view" per se. Now, we know how they get back to it when picking "New" (or at least we know that they provide a way back), but does this happen with every tab bar item selection? I admit, that's a use of the tab bar I have not seen before! (I could also just be leading a sheltered iPhone life, who knows. <grin>)
Also, when you pick "New" the tab bar goes away. That almost looks like a modal view controller to me, but perhaps it isn't. Normally, when I want to drill down to a lower view and hide the tab bar, I set the new UIViewController's hidesBottomBarWhenPushed property to YES. In this case they're not drilling down at all - they're arriving straight from the tab bar selection.
If we accept that they're using the tab bar in an unexpected way, perhaps their view controller sets hidesBottomBarWhenPushed to YES - for instance, in viewDidLoad if being initialized from a nib. This sends you down a one-way path into the view. No more tab bar! To complete the effect, they may set a left button (with the arrowhead) that heads back to that "home" view and deselects any tab bar selection.
I wonder if the home view is actually a tab bar item selection that is hidden from view? (If that's even possible. You never know. That could explain the unselected tab bar item appearance.)
Ahh, I see.
I wonder if the home view is actually a tab bar item selection that is hidden from view? (If that's even possible. You never know. That could explain the unselected tab bar item appearance.)
Ya, i too tgt like that. Maybe the 1st tab bar item responsible for the home view is being hidden, dont know. Was trying to check that out. wonder in which way it wil go. , havent done anything of that sort.
And if u want to check that out, there is a free lite version of that app in iTunes
Ya, i too tgt like that. Maybe the 1st tab bar item responsible for the home view is being hidden, dont know. Was trying to check that out. wonder in which way it wil go. , havent done anything of that sort.
And if u want to check that out, there is a free lite version of that app in iTunes
Thanks! I'll go tire-kick it a bit.
UITabBar does have a selectedItem property, which it appears can be set to nil without any ill effects. Perhaps ALL of the tab bar items use this same default view controller (defined as a singleton? possibly) in conjunction with deselecting items.
UITabBar does have a selectedItem property, which it appears can be set to nil without any ill effects. Perhaps ALL of the tab bar items use this same default view controller (defined as a singleton? possibly) in conjunction with deselecting items.
Could you please post the xcode project of what you have so far
I'm a newbie with iPhone dev and I've been developing a simple application on TV Schedule Guide that could play short video trailers. I applied what OneTeamDev's code on implimenting tab bar controller programatically and it works like a charm. so my application has a tab bar controller that displays a list of tv show scheds in a tableview. each show should play a trailer when tap but apparently it ain't. i'm using a streamlined code from Apple's movieplayer sample code and it's already been taking me ages to make it work. Perhaps, you guys could throw me some help.
#import "TVSchedAppDelegate.h"
#import "MovieViewController.h"
@implementation TVSchedAppDelegate
@synthesize window, allShowsViewController, mySecondTableViewController, tabBarController;
@synthesize mViewController;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
tabBarController = [[UITabBarController alloc] init]; // creates your tab bar so you can add everything else to it
allShowsViewController = [[AllShowsButtonController alloc] init]; // creates your table view - this should be a UIViewController with a table view in it, or UITableViewController
UINavigationController *tableNavController = [[[UINavigationController alloc] initWithRootViewController:allShowsViewController] autorelease];
allShowsViewController.title=@"TV Shows";
tableNavController.tabBarItem.image = [UIImage imageNamed:@"home_20.png"];
[allShowsViewController 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 = [[UITableViewController 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 addSubview:mViewController.view];
[window makeKeyAndVisible];
}
- (void)dealloc {
[tabBarController release];
[mViewController release];
[window release];
[super dealloc];
}
@end
You probably haven't set the class name of the table controller in IB. Click the table controller, click the 4th tab in the inspector and type in MyTableViewController or what ever you called it (If it doesn't autocomplete its wrong, it looks up the .h file).
Note:
Table data is usually declared in the table controller. You can create it in the viewDidLoad method.
Great Thread! Healthy debate over pure code vs. IDE tools.
I am more interested in using the IDE tools; therefore I have a conceptual question for clarification:
Is it required/recommended for MainWindow.xib to be the root of all UI Controllers/Views?
e.g. I have been working on an app where the TabBarController is in the MainWindow.xib, but one of the tabs is to be a Navigation based table view and it's nib contains the NavigationController, Table View etc... and an exception is thrown when I try to load that view.
I am hoping that by restructing the MainWindow.xib to govern all UI in a hierarchical fashion will resolve these matters and I can get on with the more complex aspects of the app.
I would just like to know that doing this restructure is the correct path to follow. I have been piecing together a larger app from smaller samples...
btw indiekiduk, is your demo video posted elsewhere? I tried to download from your original link, but the file was invalid...
Hey there,
Your should have ViewController for every tab that you need. So if you want five tab bar items you need 5 view controllers and 5 nib files. Say, ViewOne.xib, ViewTwo.xib and so on..
All the nib files need to have their file owner as the ViewControllers. So ViewOne will have ViewOneController as its file owner. Add a tab bar and a tab item to each one of the view in IB.
And in your AppDelegate, you would initialize your view controller from the nib and add it to the tab bar controllers in the MainWindow.xib nib file
Code:
ViewOneController *viewOneController = [[[ViewOneController] alloc] initWithNibName:@"ViewOne" bundle nil];
//Repeat the above for all the other four views
tabBarController.viewControllers = [NSArray arrayWithObjects: viewOneController, ViewTwoController,......, nil];
If you still have problems, can you zip your folder and post it online, So I can take a look at it. You can strip all the other code that you would like to keep it confidential..
I can take a look at it later tonite and get back to you.
Javid
Hi
I read your answer and follow the same process and got able to load 5 view with 5 tab bar item in applicationDidFinishLaunching. On each tab item click it loads related view.There are some button control in my first view ,table in 2nd view and etc.
I want to load a new view on button control click action in side first view and new loaded view add new tab bar with 4 tab bar item. I mean replace or hide previous 5 item tab bar control. also want to add nav bar.
I am trying but not able to do it.
I am creating tab bar programmatically.
In the application that i am doing now,
1. In the main page it lists all the persons in database.
2. I have given a + button on the right top of that page.
3. When i click on that button, It goes into a page from where i can add a new record.
4. When i press cancel it goes to previous page but since the page isn't refreshed i cant see the record that i added recently.
5 But if i restart the application i can see that record.
I wanted to know how to make that main page refreshed so that i will be able to see the new record?
I got the UIWebView in UITableViewCell view problem solved by using the three20 UI framework(joehewitt's three20 at master - GitHub). You can use the web content hyperlinek as click able text in labels also , you can estimate the total hight of label ,calculating the text that will fit in. UI looks like Twitter iPhone application UI. Only got to create some more delegate. For any help plz be free to contact me.