5
5
*************************
6
6
7
7
SQLiteManager is a simple Class "wrapper" to use SQLite3 within iOS SDK.
8
- It provides methods to connect/create a database in your documents app folder, do a simple query, get rows and close the connection.
8
+ It provides methods to:
9
+ - connect/create a database in your documents app folder
10
+ - do a simple query
11
+ - get rows in NSDictionary format
12
+ - close the connection
13
+ - dump your data in sql dump format
9
14
10
15
For the moment that's all ;)
11
16
12
- SQLiteManager is made by Ester S�nchez (aka misato) and it's free to use, modify and distribute.
17
+ SQLiteManager is made by Ester Sanchez (aka misato) and it's free to use, modify and distribute.
13
18
If you use it, don't forget to mention me as the original creator.
14
19
15
20
Thanks and enjoy!
@@ -25,53 +30,5 @@ Just drag the two classes into your project. Also you need to import SQLite3 fra
25
30
The code is pretty self-explanatory so i hope you'll understand it.
26
31
If you have any doubts, don't hesitate to contact me at esanchez [at] misato [dot] es
27
32
28
- An example of the usage could be:
29
-
30
- myView.h
31
- ---------
32
-
33
- @interface myView : UIViewController {
34
- SQLiteManager *dbManager;
35
- }
36
-
37
- - (void)insertData;
38
- - (void)getRows;
39
-
40
- @end
41
-
42
- myView.m
43
-
44
- @implementation myView
45
-
46
- - (void)viewDidLoad {
47
- //init SQLiteManager
48
- dbManager = [[SQLiteManager alloc] initWithDatabaseNamed:@"myDatabase.db"];
49
- }
50
-
51
- //do an insert
52
- - (void)insertData {
53
- NSError *error = [dbManager doQuery: @"insert into myTable (column1, column2) values ('value1','value2');"];
54
- //if an error has occurred
55
- if (error != nil) {
56
- NSLog(@"An error has occurred: %@", [error localizedDescription]);
57
- }
58
- }
59
-
60
- // get all data from mytable
61
- - (void)getRows {
62
-
63
- NSArray *rowData =[dbManager getRowsForQuery:@"select * from mytable"];
64
-
65
- NSLog (@"Row data: %@", rowData);
66
- //do stuff with your data
67
-
68
- }
69
-
70
- - (void)dealloc {
71
- [super dealloc];
72
- [dbManager release];
73
- }
74
-
75
- @end
76
-
33
+ You have also an usage example in SQLiteManagerExample directory.
77
34
0 commit comments