• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iOS database within sandbox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS database within sandbox


  • Subject: Re: iOS database within sandbox
  • From: BareFeetWare <email@hidden>
  • Date: Mon, 25 Aug 2014 17:09:35 +1000

We developed a simple BFWQuery class for accessing SQLite databases as if they were NSArrays. It is designed to make it simple for Cocoa developers to get up and running without sacrificing any of the power of SQLite. It uses FMDB under the hood.

It might be useful for you.

https://github.com/barefeettom/BFWQuery <https://github.com/barefeettom/BFWQuery>
or:
https://bitbucket.org/barefeetware/bfwquery

Basically, you instantiate a query like this:

    BFWQuery* query = [[BFWQuery alloc] initWithDatabase:self.database
                                             queryString:@"select * from Country order by Name where Name = ?"
                                               arguments:@[countryName]];

You can get the rowCount like this:

query.rowCount;

or:

query.resultArray.count;

and iterate through result rows like this:

for (NSDictionary* rowDict in query.resultArray)

Behind the scenes, it only creates each row when needed. It doesn't pre-populate a whole array.

Tom 👣

> On 23 Aug 2014, at 10:54 am, Carl Hoefs <email@hidden> wrote:
>
> I’m writing a Cocoa-based iOS 8 app that needs to store and manage data locally on the device. Is there a relational database available for general purpose use in iOS 8? Is there a limitation to how much space an app can use in its sandbox? I presume a database would necessarily need to reside in <Application_Home>/Documents/...

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >iOS database within sandbox (From: Carl Hoefs <email@hidden>)

  • Prev by Date: How is the "-NSPrint" command line option supposed to be used?
  • Next by Date: Crash from NSURLConnection if delegate released too soon?
  • Previous by thread: Re: iOS database within sandbox
  • Next by thread: Re: <null> value in KVO change dictionary ?
  • Index(es):
    • Date
    • Thread