Skip to content

Commit b961a74

Browse files
committed
Updates Demo project
1 parent 88bccfd commit b961a74

File tree

6 files changed

+29
-4
lines changed

6 files changed

+29
-4
lines changed

Demo/.DS_Store

0 Bytes
Binary file not shown.

Demo/AFSQLManager-Demo.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
3840A73019661A1500AADB8C /* caja.sql in Resources */ = {isa = PBXBuildFile; fileRef = 3840A72F19661A1500AADB8C /* caja.sql */; };
1011
A73B900E18FFF55E009CECF0 /* test.sqlite in Resources */ = {isa = PBXBuildFile; fileRef = A77919F418FFECBA008FFC3A /* test.sqlite */; };
1112
A74038AB18FFC523001D71DD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A74038AA18FFC523001D71DD /* Foundation.framework */; };
1213
A74038AD18FFC523001D71DD /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A74038AC18FFC523001D71DD /* CoreGraphics.framework */; };
@@ -38,6 +39,7 @@
3839
/* End PBXContainerItemProxy section */
3940

4041
/* Begin PBXFileReference section */
42+
3840A72F19661A1500AADB8C /* caja.sql */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = caja.sql; sourceTree = "<group>"; };
4143
A74038A718FFC523001D71DD /* AFSQLManager-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AFSQLManager-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; };
4244
A74038AA18FFC523001D71DD /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
4345
A74038AC18FFC523001D71DD /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -94,6 +96,7 @@
9496
isa = PBXGroup;
9597
children = (
9698
A77919F418FFECBA008FFC3A /* test.sqlite */,
99+
3840A72F19661A1500AADB8C /* caja.sql */,
97100
);
98101
name = Resources;
99102
sourceTree = "<group>";
@@ -263,6 +266,7 @@
263266
files = (
264267
A74038C318FFC523001D71DD /* Images.xcassets in Resources */,
265268
A74038B518FFC523001D71DD /* InfoPlist.strings in Resources */,
269+
3840A73019661A1500AADB8C /* caja.sql in Resources */,
266270
A74038BE18FFC523001D71DD /* Main.storyboard in Resources */,
267271
A73B900E18FFF55E009CECF0 /* test.sqlite in Resources */,
268272
);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SuppressBuildableAutocreation</key>
6+
<dict>
7+
<key>A74038A618FFC522001D71DD</key>
8+
<dict>
9+
<key>primary</key>
10+
<true/>
11+
</dict>
12+
<key>A74038C718FFC523001D71DD</key>
13+
<dict>
14+
<key>primary</key>
15+
<true/>
16+
</dict>
17+
</dict>
18+
</dict>
19+
</plist>

Demo/AFSQLManager-Demo/.DS_Store

6 KB
Binary file not shown.

Demo/AFSQLManager-Demo/AFSQLManager.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,21 @@ -(void)performQuery:(NSString *)query withBlock:(completionBlock)completion {
114114
NSString *fixedQuery = [query stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
115115

116116
sqlite3_stmt *statement;
117-
117+
118118
if (sqlite3_prepare_v2(_database, [fixedQuery UTF8String], -1, &statement, nil) == SQLITE_OK) {
119119

120120
while (sqlite3_step(statement) == SQLITE_ROW) {
121121

122122
NSMutableArray *row = [NSMutableArray array];
123123

124124
for (int i = 0; i < sqlite3_column_count(statement); i++) {
125-
126-
[row addObject:((char *)sqlite3_column_text(statement, i)) ? [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, i)] : @""];
125+
126+
[row addObject:((char *)sqlite3_column_text(statement, i)) ? [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, i)] : [NSNull null]];
127127
}
128128

129-
completion(row, nil, NO);
129+
if (completion) {
130+
completion(row, nil, NO);
131+
}
130132
}
131133

132134
sqlite3_finalize(statement);

0 commit comments

Comments
 (0)