how to add tab bars? - iphone

i m having an view based application,
in my second view i want to have an 5 tabs.
but i hv no idea how to implement it.
i hv already added 5 tabs,but its not working, any tutorials or somethionng will be very helpfdul
thanks a ton

I found this one quite helpfull back in the days when I started programming.
Tutorial for iPhone app with UITabBarController and UINavigationController
On another note:
If you start developing with the "Tab Bar Application" template from XCode things might be a little bit easier to start with.
I would also question the Design of an application that is view based and has a tabcontroller only in one of its modal views. I'm not sure if this is reason enough for your app to be rejected, but i could imagine that this sort of UI design might not be in line with Apples iPhone Human Interface Guidelines

Related

ios app second screen

I am a beginner to the iOS app development and working on a sample app that consists of just two "screens" - the first screen authenticates the user against user id and password saved in a SQLite database table and the second screen displays list of users in the database if user authentication is successful. If authentication fails I would just like an alert displaying appropriate message to the user.
I somehow can not connect how to "go to the second screen" if user authentication is successful. How can I tell the application that now that the user is authenticated it is time to go to the second screen and display the list of users?
I apologize if the terminology I use is not standard iOS app development terminology but I am new and would like to fill the gaps in my understanding. Please feel free to direct me to any links/tutorials/documentation.
Thank you.
Navigation is a fundamental and essential part of iOS programming and UX design. Traditionally, views are managed by ViewControllers, which in turn may be managed by NavigationControllers in stacks. To naivgate between and away from controllers, we define two new verbs: Push and Pop. To go to a new view, one pushes it onto the navigation stack. To transition away from a view, one pops it off the stack. And so, with these two paradigms, we can define simple transitions which are managed by the UINavigationController object. Have a look at the navigation guide in the docs before you proceed any further.
You don't appear to have sufficient understanding of iOS basics for any of our answers to be helpful. A word of advice: don't waste your time wrestling with code before you have a bit more of a foundation; you will just become frustrated.
Take a few hours and review some of the videos in Paul Haggarty's Standford iOS course.
Once you understand some of the building blocks and concepts of the API, things will move along much more quickly.
Are you developing against iOS with Storyboards?
If you start with the boilerplate "Master/Detail" template in Xcode for iOS 5 with Storyboards, you will get some sample code for a master view (uses a UITableView), detail view (uses a UIView with a label in it), and a segue between the two view controllers to go from master to detail, along with a "Back" navigation button that pops the detail view off and back to the master view.
The iPad boilerplate for that type of project is slightly different in the it uses a UISplitViewController to show both master and detail at the same time and doesn't use a segue between the two.
You could take a look at that boilerplate code, modify it, and go from there.

IOS new Facebook iPhone App UISplitViewController Layout [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
SplitView like Facebook app on iPhone
another break away .net developer here now trying to get used to the world of IOS.
I like the layout of the new Facebook iPhone app (October 2011), and want to implement something similar in an app I am doing. I know that the UISplitterControl is not available on iPhone but Facebook seem to have pulled a little magic to make it appear so on their new app.
In Facebook's implementation it looks to me that they have used a UINavigationController which slides to the right by x when the NavigationBar icon is tapped thus exposing a view underneath with the menu items.
Would appreciate if someone could help me work this out as the solution would also be a great learning curve.
I've tried setting a UINavigationController as the AppDelegate window root view controller, then using initwithframe to load a custom view which includes the menu items as a subview hidden behind the UINavigationcontroller root view. Then when the UINavgationController menu item button is clicked slide the NavigationController to the right thus exposing the view underneath with menu items.This presents two problems, first that the subview positioning doesn't work and also how can I slide the actual UINavigationController to the right to expose the menu view underneath.
Please help!
Might also want to check out my implementation on Github. It's specifically designed to resemble Facebook's implementation as much as possible (from a technical point of view). Also it leverages iOS 5's new UIViewController-Containment features, which most others don't. Thus it works flawlessly in both landscape and portrait modes. It's universal of course and highly flexible. One class only. The way you use it is similar to any other Apple made controller.
there is a similar post here: SplitView like Facebook app on iPhone.
you can also checkout the code directly at: https://github.com/mystcolor/JTRevealSidebarDemo
I'm having exactly the same question, my guess is that the "SplitView" is actually more likely a modal view that takes up only part of the screen. I haven't had the time to try it just yet but the following post might give some hint on how this can be done:
http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/
You might want to check out this project
https://github.com/aaronbrethorst/StackScrollView
Here some howto
http://cocoacontrols.com/posts/how-to-build-the-twitter-ipad-user-experience
Similar to the one "MyPad" is using.
Note: This is only for iPad but you might find some usefull stuff in it
I created a component that mimics the behavior of the Facebook slide out menu. It is available on github.
Here is link from stack overflow where people have discussed on same topic.
Also there are several links that can be helpful:
SplitView like Facebook app on iPhone

Architecting iPhone Views - seeking help on a specific issue + general advice

I am primarily a web developer (ruby, python) that is new to iPhone development. I've done some desktop development in the past within the MS environment (C#), but never anything on the mac.
I'm trying to build a really simple iPhone application and I am confused by the way that views work in general. If someone can provide advice for my particular problem, along with some resources where I can learn how to architect iPhone views in the future, that would be awesome. I feel like a lot of the Apple documentation that I've come across is too specific - I am lacking a fundamental understanding of how views work on the iPhone.
My particular problem looks like this:
I need one view that displays some downloaded text content. This is the view that shows when the app loads, and it is pretty straightforward.
Then I need a settings area (I've already decided I don't want to use the iPhone settings area). The settings area main page will have some text fields on it. It will also have a 2-row grouped table. Each cell in that table will take you to another view which also has a grouped table used for multi-select. I suspect that I can reuse the same view for these two final "detailed setting" views.
In summary:
home page
settings main page
detailed setting 1
detailed setting 2
Any help and advice appreciated.
It sounds like you already have a good idea of what you want each of your screens to look like; that's a good place to start.
What you're probably going to want to do is use Interface Builder to lay out the objects in each view (textfields, buttons, etc.), and then have a custom View Controller (subclass of UIViewController) for each view. You would then navigate to a new view by doing something like:
MySettingsController *controller = [[MySettingsController alloc]
initWithNibName:#"SettingsView" bundle:nil];
[[self navigationController] pushViewController:controller animated:YES];
(assuming a navigation-based app).
If you haven't yet, I recommend reading Apple's View Controller Programming Guide
Some advice: Despite your back ground, don't think of the views as pages or the app as a web site. That will cause you problem in your design because the technology is different and views don't work like web pages and apps don't work like web sites.
The major difference is that while web pages often contain actual data, views do not. The view object is only concerned with display. It doesn't know what it is displaying and it doesn't store or logically manipulate the data. The data comes into the view from the view controller which itself gets it from the data model.
See Cocoa Core Competencies: Modal View Controller
Rails uses MVC if you've used that with Ruby. The basic principles are the same.
Well, there are plenty of information on Apple developers' pages: you could start reading Your first iPhone application
There are quite a few good sites with very good info both on cocoa and iPhone developing:
Cocoa with love
iCode blog
and many more (google is your friend in this).
A couple of books I liked are "Beginning iPhone3 Development" and "iPhone developer cookbook".
The first is probably more useful at the beginning (no pun intended)
As for the specific case of yuor application, you could use a navigation controller for the settings page, and each time you need to dive into the details you will just push the right view onto the navigation controller's view stack.
So you would design 4 views with the interface builder
Main view
Settings view
Detail 1
Detail 2
And then push the views onto the navigation controller.
It's pretty straightforward, I won't go into the details, but just searching something like "iphone navigation controller example" on google will give you plenty of samples that you can easily adapt to your needs.
These were all helpful responses, in particular the reference to the iPhone View Programming Guide. This helped me to diagnose my misunderstanding which was related to the role of View Controllers, and the relationship between individual views and view controllers. I think part of my confusion came from learning MVC in the context of Rails, where this relationship is quite different.
For others looking for advice in this general area, I would recommend checking out Lecture 6 from Stanford's iTunes U iPhone Application Development course from Winter 2010 "Designing iPhone Applications, Model-View-Controller, View Controllers", and the lectures 5 & 7 if you have time. I think that was when the penny dropped for me, despite having already looked at a few of the books mentioned here.

iphone application layout

I'm trying to get started with an iPhone application, I had a look around at other questions but i'm still sorta stuck so hopefully someone can help...
First thing is I'm totally confused with the whole view concept, I'm more used to visual studio so I'm going to use the term 'form' to describe what I have in my head.
I want to achieve a home screen in an application with say 9 icons (much like the iphone home screen) which each lead to a different 'form'. Each form may have a different function so say one might be a simple calculator, one might play a video etc.
How do I do this, its destroying my soul trying to do something so simple... If you guys even have any links to get me on the right track it would be greatly appreciated
I suggest you take a look at the Stanford iPhone Programming Course. If you don't have the time to look through it all, I reccommend at least Lectures 5 and 6 about Views and ViewControllers. The slides are quite instructive and they come with video presentations that should help you get on your way in about an hour.
Apple's samples are a great place to start. There are some simple ones that can show you how views and view controllers work.
Also, in Xcode, when you create a new iPhone app template, that template usually has enough code to display a view, and sometimes a flip-side view or more. Sometimes, you should stop reading, and do.
I had the same weird learning curve as you, as things don't initially seem to make sense but they do - and once you've got your head round them they make perfect sense trust me!
Your 'forms' are viewControllers in this M-V-C land, they control all the 'view' (which are controls or any object which can be seen) within them. Normally they are loaded from a Nib (design from the interface builder), but don't have to be.
The way I would go about your problem is to use a navigationController as the base to handle all of your view controllers.
A navigation controller needs a rootviewcontroller to start so this will be your desktop Viewcontroller. I'm not sure how you are planning to populate this but all the icons will need to be stored in some kind of array. I suggest you use a simple UIButton. When then button is pressed you then alloc and init and push the required view controller.

How to create this customized UI?

i m new to iphone development
i want to create a view like this..
1.home screen contains
a. a navigation bar
b.a uiimageview
c.a toolbar(with 4 buttons)
2.new view contains
a.navigation bar with back button which leads to home screen.
b.a UITableView.
3.another table view
with navigation bar leads back to (2nd view)
note i want to load new view with the tool bar button.
That's excellent. Thanks for the update! Keep us informed on how you're doing with that.
Actually, it would be a disservice to you for us to write your code for you. Why don't you try looking at Apple's sample code on the iPhone Dev Center? It'll answer your question.
You can come back here and post code that you've tried that isn't working.
Probably not the answer you want, but I'm pretty sure you'll benefit more from actually researching the question and trying it out on your own.
Following up on Jordan's answer, the place you want to start is Getting Started w/ iPhone OS. For the type of code you're talking about, you should then investigate the View Controller Programming Guide. When you've gone through the samples and start having trouble with your own code, the Cocoa/iPhone crowd here at Stack Overflow is incredibly helpful. But a statement of program requirements isn't an SO question.