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 03-09-2009, 04:23 PM   #1 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 2
Default Tab Bar + Multiple Table Views + SQLite

Hi guys!

I'm trying to build an app that uses data from a sqlite database.

The navigation is done by multiple tabs like the iPod app, each tab connects to a table view that presents to the user a especific type of data retrieved from the database (for ex. imagine the database is a restaurant list, each tab presents a unique type of cuisine: french, chinese, etc...)

However the tutorials that i find around the net only represent/teach how to make an app that works with a database in a single view, without any tab controller...
I don't know how i can adapt the tutorials i find to my needs, or even the example SQlite books from the great Apple. . .

Can somebody point to me the right direction??

Thanks in advance
avantime is offline   Reply With Quote
Old 03-10-2009, 12:04 PM   #2 (permalink)
New Member
 
Join Date: Jan 2009
Posts: 9
Default

Quote:
Originally Posted by avantime View Post
Can somebody point to me the right direction??
Up the street and turn to the left.

Just a wild guess here, but couldn't you just code each tab to search your database?

Cheers,
ptervin
ptervin is offline   Reply With Quote
Old 03-21-2009, 02:25 AM   #3 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 1
Smile

Hello,

I ran into the same problem, having a tab view and trying to connect a Sqlite database to the different views.
Is there anybody out there with an idea or resource?
I really would appreciate, thank you!
weplay is offline   Reply With Quote
Old 03-30-2009, 11:14 AM   #4 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 1
Default

Open the database in the "applicationDidFinishLoading"-method within the appDelegate. Once it's open you can access it from within the different viewcontrollers via

MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication]. delegate

appDelegate.myDatabase
Peter Pan is offline   Reply With Quote
Old 03-30-2009, 11:25 AM   #5 (permalink)
iGP
New Member
 
Join Date: Feb 2009
Posts: 19
Default

Have look at the TheElements sample code...
iGP is offline   Reply With Quote
Old 03-30-2009, 11:45 AM   #6 (permalink)
m0s
Registered Member
 
Join Date: Mar 2009
Posts: 122
Default

Quote:
Originally Posted by Peter Pan View Post
Open the database in the "applicationDidFinishLoading"-method within the appDelegate. Once it's open you can access it from within the different viewcontrollers via

MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication]. delegate

appDelegate.myDatabase
I assume that this:

returns a pointer ( *appDelegate ) to your appDelegate that you can then use to retrieve / interact with variables instantiated in the app Delegate class.

- > if you have a variable myDatabase (in appDelegate) and a method (in app Delegate) getlatestvalueofcolumnDay - you could access this from a view controller calling this method on appDelegate.myDatabase.

I have thought of using this method (ie retrieving data in appDelegate) as i imagine it is a much better way to implement a multiview / single data source rather than have each individual view retrieve it's own relevant data. Any thoughts about this?
m0s is offline   Reply With Quote
Old 04-08-2009, 06:30 PM   #7 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 7
Default

Quote:
Originally Posted by iGP View Post
Have look at the TheElements sample code...
where can I find this ?
XeNo is offline   Reply With Quote
Old 04-09-2009, 03:40 AM   #8 (permalink)
pkt
Registered Member
 
Join Date: Jan 2009
Posts: 15
Default

Quote:
Originally Posted by XeNo View Post
where can I find this ?
Here you are Sign in with your Apple ID - Apple Developer Connection)!
pkt is offline   Reply With Quote
Old 04-09-2009, 01:29 PM   #9 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 7
Default

Quote:
Originally Posted by iGP View Post
Have look at the TheElements sample code...
Quote:
Originally Posted by pkt View Post
thanks buddy.
XeNo is offline   Reply With Quote
Reply

Bookmarks

Tags
database, multiple views, sqlite, tabbar, table

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: 271
17 members and 254 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

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