How to retrieve data from database(sqlite3)? - iphone

I have 5 view controllers (Tab bar based)and a button named "add to favourite" in one of view controller.When user click on the button respective data is saved(not push to any view controller) and when user click on favourite icon(in tab bar) the data will show in a table view. How it will be done? I tried with NSMutableArray but in favourite view controller it is null. Is it possible with sqlite3?

Related

how to add a uitab bar controller with non of the tab get selected?

I have added an UITabBarController. My requirement is to display a view with tab bar controller. but that view is not part of the tab bar items. For example my tab bar contains 3 tabs
contacts
camera
history
Generally if we add tabbar controller contacts will be get selected and that view will be displayed automatically. but i don't want in that way...
i used [tabBarcontroller setSelectedViewController=nil];
i am able to get a tab bat with non of the tab get selected. but when i am trying to select a tab item it's not working.. I think i set the selectedViewController to nil. is there any other way to achieve my requirements...?
please explain your answer clearly.. i am new to iphone app development..
Present a view controller which is not a part of your tab bar controller and put a tab bar image/buttons at the bottom of it which resembles your tab bar. When you receive a button pressed message from within that view controller, show that tab on screen.

How to go back to the parent table view?

my iPhone application consists of a Tab bar controller with several navigation controllers within it, with table views in each of them.
I want it so that after I click on a tab bar item, if I go deeper into the table hierarchy and then click on another tab bar item, if I return back to the tab bar item before, that it goes back to the parent table.
Is there a method to somehow do this?
How about using [navigationController popToRootViewControllerAnimated:NO] when a tab is selected?

Navigation back to main view

I have a root view controller as the navigation controller. In the root view controller nib file I have 3 buttons (button 1, button 2, button3). Each of which has a table view contoller Eg: Flow of the buttons (I have followed the navigation logic such that at any time I can get back to the root view controller by selecting the back button).
On Button 1 click => table view shown ==> detail view shown on item click/selection
On Button 2 click => table view shown ==> detail view shown on item click/selection
This logic holds good for all the buttons. In the detail view I have a button.
What I want is on the click of this button, the button 3 logic should be called such that, when i click or press the back button from the table view of 3rd button, I should get back to the main root view controller with all the buttons visible.
Please let me know how should i go ahead with the same.
I believe you'll want to use the - (NSArray *)popToRootViewControllerAnimated:(BOOL)animated found in UINavigationController. As the name suggests, this will allow you to pop back to the root view controller at any time.

iPhone: How to work on this (Tab bar controller and navigation controller)

hi i am working on Tweet app- 1) it have Main View Controller and four sub view Controller(ie Profile view, Tweet view, setting view, help view)
2) on Main View Controller- Four UIButtons are Profile UIButton , Tweet UIButton, Setting UIButton and Help UIButton
3)on Button action it moves to respective view (i.e on Main View Controller, clicking Profile UIButton, action Moves to Profile view Controller like this for all view respectivly)
for me i want One TabBarController, only on Profile view(NOT ON OTHER VIEW )
on Tweet View Controller with one Custom Table View (with out Tab Bar Controller)
On all view,Move Back to Main View Controller (view) one navigation Item (Note;- not on Main View Controller)
can i do this, i work on this NOT getting output
How i have to work on this, to work the app
Thank you
nanda
You can make this by using tabBar application in xcode's new project then you need to make tabs and for each tab use navigation controller and set mainwindow's load sreen by setting nib name in main window and controller file(in inspector for main window). you need to implement like following-

Referencing view in tabbar app?

I have a tabbar based app and would like to reference one of three views. There are three tabs. When tab2 is clicked, tab2view is created. tab1view needs to reference tab2view so it can be pushed into view. tab2view can be pushed into view via tab2 or tab1view. How do I give tab1view a reference to tab2view?
tab1view will also need to create tab2view if it hasn't already been created from a tab click.
You don't push views with UITabBarControllers, you add View Controllers to an array that get displayed when the user clicks the appropriate tab bar item. If by "push" you mean "switch to tab" then you just need to set the "selectedIndex" property of your TabBarController.
But I don't understand this dependency you have where the second tab's view controller has to be created by the first. If you're not seeing your second tab view when you click on the second tab button, then it means you're doing something wrong in building the tab bar itself.
Regardless, all view controllers in your tab bar are accessible via the "viewControllers" array so getting the second one would be:
UIViewController *secondVC = [[myTabBarController viewControllers] objectAtIndex:1];