Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jguru

macrumors member
Original poster
Apr 10, 2008
43
0
Hi,

I am trying to use sqlite with my iphone application.. now i do get to initialize it properly *i think* but i am trouble figuring out how to query the database and how to be able to access the data from different views. Do i have to create database handler in every view?

any help?

thanks
 
Are you instantiating the database object in a class or a view delegate? You would probably need to instantiate it in any delegate or controller that manages the group of views so as you can pass it to each view from a central storage area. If not, then you need to instantiate it in the new currentView and dealloc the old instance so as to free up memory resources and not leak.
 
I would recommend looking at the SQLite books sample. It does pretty much everything you would need to do with sqlite.
 
I would recommend looking at the SQLite books sample. It does pretty much everything you would need to do with sqlite.

Hi...

As you mentioned the sample codes above, i would like to ask a query...

I tried detaching a thread using NSThread, but its giving me a message :

Releasing with no autoreleasepool -object of class CFFont just leaking

I tried with the "EARTHQUAKE" (which is example for multithreading) sample also... for that also its giving the same leaking message.. what i want to do?

Being beginner, we used to refer and follow whatever in sample codes, hoping that those are perfect ones, moreover we used to go through the documentations also, but sample codes expalins us more (obviously)...

What extra care i want to take while detaching a new thread?

Also if i detach two threads.. [NSThread exit]; will terminate which thread ??


Also i am using some property inside my thread method..

llike i craeted a property of UIActivityIndiactor class, starting inside the thread, while main will parse the files.. After that in main, after parsing i will stop the activityIndicator.

So i cant declare activityIndicator locally inside thread method, as i want to stop it in main...

Moreover my thread method is just to start the activityIndicator...
 
Hi,

I am trying to use sqlite with my iphone application.. now i do get to initialize it properly *i think* but i am trouble figuring out how to query the database and how to be able to access the data from different views. Do i have to create database handler in every view?

any help?

thanks

Hi, using this wrapper makes the development much easier: http://code.google.com/p/entropydb/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.