<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Th30z - Coding on the Fly &#187; SQLite</title>
	<atom:link href="http://th30z.netsons.org/tag/sqlite/feed/" rel="self" type="application/rss+xml" />
	<link>http://th30z.netsons.org</link>
	<description>Matteo Bertozzi, Objective-C, Cocoa, C, C++, Qt4, iPhone, Mac OS X, Open Moko, Matteo Bertozzi Development</description>
	<lastBuildDate>Sun, 22 Nov 2009 09:47:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Objective-C: SQLite Wrapper</title>
		<link>http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/</link>
		<comments>http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 06:41:15 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=317</guid>
		<description><![CDATA[I&#8217;ve written a simple SQLite Wrapper with two Examples one for Mac and one for the iPhone. The Wrapper class has the same source code for both platforms.
Here you can find the Mac Example Source Code and the iPhone Example Source Code.

This is a simple usage example:

Sqlite *sqlite = [[Sqlite alloc] init];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve written a simple SQLite Wrapper with two Examples one for Mac and one for the iPhone. <em>The Wrapper class has the same source code for both platforms</em>.</p>
<p>Here you can find the <a href="http://th30z.netsons.org/wp-content/uploads/mac-testsqlite.zip">Mac Example Source Code</a> and the <a href="http://th30z.netsons.org/wp-content/uploads/iphone-testsqlite.zip">iPhone Example Source Code</a>.</p>
<div><a href="http://th30z.netsons.org/wp-content/uploads/iphonesqlitetest.png"><img src="http://th30z.netsons.org/wp-content/uploads/iphonesqlitetest-188x350.png" alt="iPhone Test SQLite App" title="iPhone Test SQLite App" width="188" height="350" class="aligncenter size-medium wp-image-318" /></a></div>
<p>This is a simple usage example:</p>
<pre>
Sqlite *sqlite = [[Sqlite alloc] init];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
                             NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory
                        stringByAppendingPathComponent:@"SQLiteTest.db"];
if (![sqlite open:writableDBPath])
  return;

[sqlite executeNonQuery:@"CREATE TABLE test (key TEXT NOT NULL, value TEXT);"];
[sqlite executeNonQuery:@"DELETE FROM test;"];
[sqlite executeNonQuery:@"INSERT INTO test VALUES (?, ?);",
                        [Sqlite createUuid], @"PROVA"];
[sqlite executeNonQuery:@"INSERT INTO test VALUES (?, ?);",
                         [Sqlite createUuid], @"PROVA 2"];
[sqlite executeNonQuery:@"INSERT INTO test VALUES (?, ?);",
                         [Sqlite createUuid], @"PROVA 3"];

NSArray *results = [sqlite executeQuery:@"SELECT * FROM test;"];
for (NSDictionary *dictionary in results) {
  NSLog(@"Row");
  for (NSString *key in [dictionary keyEnumerator])
      NSLog(@" - %@ %@", key, [dictionary objectForKey:key]);
}

[results release];
[sqlite release];
</pre>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
