using sqlite3 on iphone app

Discussion in 'iOS Programming' started by jguru, Jul 2, 2008.

  1. jguru macrumors member

    Apr 10, 2008

    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?

  2. tacoman667 macrumors regular

    Mar 27, 2008
    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.
  3. admanimal macrumors 68040

    Apr 22, 2005
    I would recommend looking at the SQLite books sample. It does pretty much everything you would need to do with sqlite.
  4. sujithkrishnan macrumors 6502

    May 9, 2008

    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...
  5. cleverapps macrumors newbie

    Aug 1, 2008
    Hi, using this wrapper makes the development much easier:

Share This Page