-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSqlObject.m
48 lines (35 loc) · 801 Bytes
/
SqlObject.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// SqlObject.m
//
// Sqlite Objective C wrapper by Stephen Anderson is licensed under
// a Creative Commons Attribution-ShareAlike 3.0 Unported License.
// Permissions beyond the scope of this license may be available at
// ruralcoder.com.
#import "SqlObject.h"
#import "SqliteQuery.h"
@implementation SqlObject
@synthesize sqliteQuery;
- (id) initWithData:(SqliteQuery*)query
{
if (query == nil)
return nil;
NSParameterAssert(query);
if ([query step] != SQLITE_ROW)
return nil;
self = [super init];
if (self)
{
self.sqliteQuery = query;
}
return self;
}
- (BOOL) nextRecord
{
return ([self.sqliteQuery step] == SQLITE_ROW);
}
- (void) dealloc
{
self.sqliteQuery = nil;
[super dealloc];
}
@end