├── JWDFMDB-Data.podspec ├── JWDFMDB-Data ├── JWDFMDB-Data.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── jiangweidong.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── jiangweidong.xcuserdatad │ │ └── xcschemes │ │ ├── JWDFMDB-Data.xcscheme │ │ └── xcschememanagement.plist ├── JWDFMDB-Data.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── jiangweidong.xcuserdatad │ │ ├── UserInterfaceState.xcuserstate │ │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist ├── JWDFMDB-Data │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Info.plist │ ├── JWDFMDBChatMessageData.h │ ├── JWDFMDBChatMessageData.m │ ├── JWDModel.h │ ├── JWDModel.m │ ├── Podfile │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── Podfile ├── Podfile.lock └── Pods │ ├── FMDB │ ├── LICENSE.txt │ ├── README.markdown │ └── src │ │ └── fmdb │ │ ├── FMDB.h │ │ ├── FMDatabase.h │ │ ├── FMDatabase.m │ │ ├── FMDatabaseAdditions.h │ │ ├── FMDatabaseAdditions.m │ │ ├── FMDatabasePool.h │ │ ├── FMDatabasePool.m │ │ ├── FMDatabaseQueue.h │ │ ├── FMDatabaseQueue.m │ │ ├── FMResultSet.h │ │ └── FMResultSet.m │ ├── Headers │ ├── Private │ │ └── FMDB │ │ │ ├── FMDB.h │ │ │ ├── FMDatabase.h │ │ │ ├── FMDatabaseAdditions.h │ │ │ ├── FMDatabasePool.h │ │ │ ├── FMDatabaseQueue.h │ │ │ └── FMResultSet.h │ └── Public │ │ └── FMDB │ │ ├── FMDB.h │ │ ├── FMDatabase.h │ │ ├── FMDatabaseAdditions.h │ │ ├── FMDatabasePool.h │ │ ├── FMDatabaseQueue.h │ │ └── FMResultSet.h │ ├── Manifest.lock │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── jiangweidong.xcuserdatad │ │ └── xcschemes │ │ ├── FMDB.xcscheme │ │ ├── Pods-JWDFMDB-Data.xcscheme │ │ └── xcschememanagement.plist │ └── Target Support Files │ ├── FMDB │ ├── FMDB-dummy.m │ ├── FMDB-prefix.pch │ └── FMDB.xcconfig │ └── Pods-JWDFMDB-Data │ ├── Pods-JWDFMDB-Data-acknowledgements.markdown │ ├── Pods-JWDFMDB-Data-acknowledgements.plist │ ├── Pods-JWDFMDB-Data-dummy.m │ ├── Pods-JWDFMDB-Data-frameworks.sh │ ├── Pods-JWDFMDB-Data-resources.sh │ ├── Pods-JWDFMDB-Data.debug.xcconfig │ └── Pods-JWDFMDB-Data.release.xcconfig └── README.md /JWDFMDB-Data.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'JWDFMDBData' 3 | s.version = '1.0.0' 4 | s.authors = {'jiangweidong' => 'jiangweidong@yixia.com'} 5 | s.homepage = 'https://github.com/weidongjiang' 6 | s.summary = 'ultility of jwd project JWDFMDB-Data' 7 | s.source = { 8 | :git => 'https://github.com/weidongjiang/JWDFMDB-Data-Message.git', 9 | :tag => 'v'+s.version.to_s 10 | } 11 | s.frameworks = 'Foundation', 'UIKit', 'CoreLocation' 12 | s.library = 'z', 'sqlite3.0', 'c++' 13 | s.ios.deployment_target = '8.0' 14 | #s.prefix_header_file = 'YXLiveChatKitPCH.pch' 15 | s.source_files = ["JWDFMDB-Data/**/*.{h,m,mm,c}"] 16 | s.vendored_libraries = ["JWDFMDB-Data/**/*.a"] 17 | #s.resources = ["YXLiveChatKit/Chat/chatResources/*.plist"] 18 | s.requires_arc = true 19 | 20 | end -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 76C5F2371DC98B9A0004C70F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C5F2361DC98B9A0004C70F /* main.m */; }; 11 | 76C5F23A1DC98B9A0004C70F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C5F2391DC98B9A0004C70F /* AppDelegate.m */; }; 12 | 76C5F23D1DC98B9A0004C70F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C5F23C1DC98B9A0004C70F /* ViewController.m */; }; 13 | 76C5F2401DC98B9A0004C70F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 76C5F23E1DC98B9A0004C70F /* Main.storyboard */; }; 14 | 76C5F2421DC98B9A0004C70F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 76C5F2411DC98B9A0004C70F /* Assets.xcassets */; }; 15 | 76C5F2451DC98B9A0004C70F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 76C5F2431DC98B9A0004C70F /* LaunchScreen.storyboard */; }; 16 | 76C5F24E1DC999800004C70F /* JWDFMDBChatMessageData.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C5F24D1DC999800004C70F /* JWDFMDBChatMessageData.m */; }; 17 | 76C5F2511DC9EE510004C70F /* JWDModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 76C5F2501DC9EE510004C70F /* JWDModel.m */; }; 18 | FF384AED48D91BF6C1E95A02 /* libPods-JWDFMDB-Data.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D5141DB0304888115F0CA94 /* libPods-JWDFMDB-Data.a */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | 32C339156C6DD30BBC6FBE75 /* Pods-JWDFMDB-Data.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JWDFMDB-Data.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data.debug.xcconfig"; sourceTree = ""; }; 23 | 76C5F2321DC98B9A0004C70F /* JWDFMDB-Data.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "JWDFMDB-Data.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | 76C5F2361DC98B9A0004C70F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | 76C5F2381DC98B9A0004C70F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | 76C5F2391DC98B9A0004C70F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | 76C5F23B1DC98B9A0004C70F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | 76C5F23C1DC98B9A0004C70F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | 76C5F23F1DC98B9A0004C70F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | 76C5F2411DC98B9A0004C70F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | 76C5F2441DC98B9A0004C70F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | 76C5F2461DC98B9A0004C70F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | 76C5F24C1DC999800004C70F /* JWDFMDBChatMessageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JWDFMDBChatMessageData.h; sourceTree = ""; }; 34 | 76C5F24D1DC999800004C70F /* JWDFMDBChatMessageData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JWDFMDBChatMessageData.m; sourceTree = ""; }; 35 | 76C5F24F1DC9EE510004C70F /* JWDModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JWDModel.h; sourceTree = ""; }; 36 | 76C5F2501DC9EE510004C70F /* JWDModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JWDModel.m; sourceTree = ""; }; 37 | 9D5141DB0304888115F0CA94 /* libPods-JWDFMDB-Data.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JWDFMDB-Data.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | AC062C2909C5FFA78966B0A3 /* Pods-JWDFMDB-Data.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JWDFMDB-Data.release.xcconfig"; path = "Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data.release.xcconfig"; sourceTree = ""; }; 39 | /* End PBXFileReference section */ 40 | 41 | /* Begin PBXFrameworksBuildPhase section */ 42 | 76C5F22F1DC98B9A0004C70F /* Frameworks */ = { 43 | isa = PBXFrameworksBuildPhase; 44 | buildActionMask = 2147483647; 45 | files = ( 46 | FF384AED48D91BF6C1E95A02 /* libPods-JWDFMDB-Data.a in Frameworks */, 47 | ); 48 | runOnlyForDeploymentPostprocessing = 0; 49 | }; 50 | /* End PBXFrameworksBuildPhase section */ 51 | 52 | /* Begin PBXGroup section */ 53 | 38234F7E1E72CCBEE3E1B46B /* Pods */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 32C339156C6DD30BBC6FBE75 /* Pods-JWDFMDB-Data.debug.xcconfig */, 57 | AC062C2909C5FFA78966B0A3 /* Pods-JWDFMDB-Data.release.xcconfig */, 58 | ); 59 | name = Pods; 60 | sourceTree = ""; 61 | }; 62 | 5F71A963F89C7B8FFAC55EC8 /* Frameworks */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | 9D5141DB0304888115F0CA94 /* libPods-JWDFMDB-Data.a */, 66 | ); 67 | name = Frameworks; 68 | sourceTree = ""; 69 | }; 70 | 76C5F2291DC98B9A0004C70F = { 71 | isa = PBXGroup; 72 | children = ( 73 | 76C5F2341DC98B9A0004C70F /* JWDFMDB-Data */, 74 | 76C5F2331DC98B9A0004C70F /* Products */, 75 | 38234F7E1E72CCBEE3E1B46B /* Pods */, 76 | 5F71A963F89C7B8FFAC55EC8 /* Frameworks */, 77 | ); 78 | sourceTree = ""; 79 | }; 80 | 76C5F2331DC98B9A0004C70F /* Products */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 76C5F2321DC98B9A0004C70F /* JWDFMDB-Data.app */, 84 | ); 85 | name = Products; 86 | sourceTree = ""; 87 | }; 88 | 76C5F2341DC98B9A0004C70F /* JWDFMDB-Data */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 76C5F2381DC98B9A0004C70F /* AppDelegate.h */, 92 | 76C5F2391DC98B9A0004C70F /* AppDelegate.m */, 93 | 76C5F23B1DC98B9A0004C70F /* ViewController.h */, 94 | 76C5F23C1DC98B9A0004C70F /* ViewController.m */, 95 | 76C5F24F1DC9EE510004C70F /* JWDModel.h */, 96 | 76C5F2501DC9EE510004C70F /* JWDModel.m */, 97 | 76C5F24C1DC999800004C70F /* JWDFMDBChatMessageData.h */, 98 | 76C5F24D1DC999800004C70F /* JWDFMDBChatMessageData.m */, 99 | 76C5F23E1DC98B9A0004C70F /* Main.storyboard */, 100 | 76C5F2411DC98B9A0004C70F /* Assets.xcassets */, 101 | 76C5F2431DC98B9A0004C70F /* LaunchScreen.storyboard */, 102 | 76C5F2461DC98B9A0004C70F /* Info.plist */, 103 | 76C5F2351DC98B9A0004C70F /* Supporting Files */, 104 | ); 105 | path = "JWDFMDB-Data"; 106 | sourceTree = ""; 107 | }; 108 | 76C5F2351DC98B9A0004C70F /* Supporting Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 76C5F2361DC98B9A0004C70F /* main.m */, 112 | ); 113 | name = "Supporting Files"; 114 | sourceTree = ""; 115 | }; 116 | /* End PBXGroup section */ 117 | 118 | /* Begin PBXNativeTarget section */ 119 | 76C5F2311DC98B9A0004C70F /* JWDFMDB-Data */ = { 120 | isa = PBXNativeTarget; 121 | buildConfigurationList = 76C5F2491DC98B9A0004C70F /* Build configuration list for PBXNativeTarget "JWDFMDB-Data" */; 122 | buildPhases = ( 123 | 84224CB3F4513C97FC0789CB /* [CP] Check Pods Manifest.lock */, 124 | 76C5F22E1DC98B9A0004C70F /* Sources */, 125 | 76C5F22F1DC98B9A0004C70F /* Frameworks */, 126 | 76C5F2301DC98B9A0004C70F /* Resources */, 127 | 2F299CE4BCE548712BB8CFE6 /* [CP] Embed Pods Frameworks */, 128 | 34D3AB2023C1230A016BDF65 /* [CP] Copy Pods Resources */, 129 | ); 130 | buildRules = ( 131 | ); 132 | dependencies = ( 133 | ); 134 | name = "JWDFMDB-Data"; 135 | productName = "JWDFMDB-Data"; 136 | productReference = 76C5F2321DC98B9A0004C70F /* JWDFMDB-Data.app */; 137 | productType = "com.apple.product-type.application"; 138 | }; 139 | /* End PBXNativeTarget section */ 140 | 141 | /* Begin PBXProject section */ 142 | 76C5F22A1DC98B9A0004C70F /* Project object */ = { 143 | isa = PBXProject; 144 | attributes = { 145 | LastUpgradeCheck = 0800; 146 | ORGANIZATIONNAME = YIXIA; 147 | TargetAttributes = { 148 | 76C5F2311DC98B9A0004C70F = { 149 | CreatedOnToolsVersion = 8.0; 150 | DevelopmentTeam = HF526ANGZB; 151 | ProvisioningStyle = Automatic; 152 | }; 153 | }; 154 | }; 155 | buildConfigurationList = 76C5F22D1DC98B9A0004C70F /* Build configuration list for PBXProject "JWDFMDB-Data" */; 156 | compatibilityVersion = "Xcode 3.2"; 157 | developmentRegion = English; 158 | hasScannedForEncodings = 0; 159 | knownRegions = ( 160 | en, 161 | Base, 162 | ); 163 | mainGroup = 76C5F2291DC98B9A0004C70F; 164 | productRefGroup = 76C5F2331DC98B9A0004C70F /* Products */; 165 | projectDirPath = ""; 166 | projectRoot = ""; 167 | targets = ( 168 | 76C5F2311DC98B9A0004C70F /* JWDFMDB-Data */, 169 | ); 170 | }; 171 | /* End PBXProject section */ 172 | 173 | /* Begin PBXResourcesBuildPhase section */ 174 | 76C5F2301DC98B9A0004C70F /* Resources */ = { 175 | isa = PBXResourcesBuildPhase; 176 | buildActionMask = 2147483647; 177 | files = ( 178 | 76C5F2451DC98B9A0004C70F /* LaunchScreen.storyboard in Resources */, 179 | 76C5F2421DC98B9A0004C70F /* Assets.xcassets in Resources */, 180 | 76C5F2401DC98B9A0004C70F /* Main.storyboard in Resources */, 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXResourcesBuildPhase section */ 185 | 186 | /* Begin PBXShellScriptBuildPhase section */ 187 | 2F299CE4BCE548712BB8CFE6 /* [CP] Embed Pods Frameworks */ = { 188 | isa = PBXShellScriptBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | ); 192 | inputPaths = ( 193 | ); 194 | name = "[CP] Embed Pods Frameworks"; 195 | outputPaths = ( 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | shellPath = /bin/sh; 199 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-frameworks.sh\"\n"; 200 | showEnvVarsInLog = 0; 201 | }; 202 | 34D3AB2023C1230A016BDF65 /* [CP] Copy Pods Resources */ = { 203 | isa = PBXShellScriptBuildPhase; 204 | buildActionMask = 2147483647; 205 | files = ( 206 | ); 207 | inputPaths = ( 208 | ); 209 | name = "[CP] Copy Pods Resources"; 210 | outputPaths = ( 211 | ); 212 | runOnlyForDeploymentPostprocessing = 0; 213 | shellPath = /bin/sh; 214 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-resources.sh\"\n"; 215 | showEnvVarsInLog = 0; 216 | }; 217 | 84224CB3F4513C97FC0789CB /* [CP] Check Pods Manifest.lock */ = { 218 | isa = PBXShellScriptBuildPhase; 219 | buildActionMask = 2147483647; 220 | files = ( 221 | ); 222 | inputPaths = ( 223 | ); 224 | name = "[CP] Check Pods Manifest.lock"; 225 | outputPaths = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | shellPath = /bin/sh; 229 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 230 | showEnvVarsInLog = 0; 231 | }; 232 | /* End PBXShellScriptBuildPhase section */ 233 | 234 | /* Begin PBXSourcesBuildPhase section */ 235 | 76C5F22E1DC98B9A0004C70F /* Sources */ = { 236 | isa = PBXSourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | 76C5F24E1DC999800004C70F /* JWDFMDBChatMessageData.m in Sources */, 240 | 76C5F2511DC9EE510004C70F /* JWDModel.m in Sources */, 241 | 76C5F23D1DC98B9A0004C70F /* ViewController.m in Sources */, 242 | 76C5F23A1DC98B9A0004C70F /* AppDelegate.m in Sources */, 243 | 76C5F2371DC98B9A0004C70F /* main.m in Sources */, 244 | ); 245 | runOnlyForDeploymentPostprocessing = 0; 246 | }; 247 | /* End PBXSourcesBuildPhase section */ 248 | 249 | /* Begin PBXVariantGroup section */ 250 | 76C5F23E1DC98B9A0004C70F /* Main.storyboard */ = { 251 | isa = PBXVariantGroup; 252 | children = ( 253 | 76C5F23F1DC98B9A0004C70F /* Base */, 254 | ); 255 | name = Main.storyboard; 256 | sourceTree = ""; 257 | }; 258 | 76C5F2431DC98B9A0004C70F /* LaunchScreen.storyboard */ = { 259 | isa = PBXVariantGroup; 260 | children = ( 261 | 76C5F2441DC98B9A0004C70F /* Base */, 262 | ); 263 | name = LaunchScreen.storyboard; 264 | sourceTree = ""; 265 | }; 266 | /* End PBXVariantGroup section */ 267 | 268 | /* Begin XCBuildConfiguration section */ 269 | 76C5F2471DC98B9A0004C70F /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ALWAYS_SEARCH_USER_PATHS = NO; 273 | CLANG_ANALYZER_NONNULL = YES; 274 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 275 | CLANG_CXX_LIBRARY = "libc++"; 276 | CLANG_ENABLE_MODULES = YES; 277 | CLANG_ENABLE_OBJC_ARC = YES; 278 | CLANG_WARN_BOOL_CONVERSION = YES; 279 | CLANG_WARN_CONSTANT_CONVERSION = YES; 280 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 281 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 282 | CLANG_WARN_EMPTY_BODY = YES; 283 | CLANG_WARN_ENUM_CONVERSION = YES; 284 | CLANG_WARN_INFINITE_RECURSION = YES; 285 | CLANG_WARN_INT_CONVERSION = YES; 286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 287 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 288 | CLANG_WARN_UNREACHABLE_CODE = YES; 289 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 290 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 291 | COPY_PHASE_STRIP = NO; 292 | DEBUG_INFORMATION_FORMAT = dwarf; 293 | ENABLE_STRICT_OBJC_MSGSEND = YES; 294 | ENABLE_TESTABILITY = YES; 295 | GCC_C_LANGUAGE_STANDARD = gnu99; 296 | GCC_DYNAMIC_NO_PIC = NO; 297 | GCC_NO_COMMON_BLOCKS = YES; 298 | GCC_OPTIMIZATION_LEVEL = 0; 299 | GCC_PREPROCESSOR_DEFINITIONS = ( 300 | "DEBUG=1", 301 | "$(inherited)", 302 | ); 303 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 304 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 305 | GCC_WARN_UNDECLARED_SELECTOR = YES; 306 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 307 | GCC_WARN_UNUSED_FUNCTION = YES; 308 | GCC_WARN_UNUSED_VARIABLE = YES; 309 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 310 | MTL_ENABLE_DEBUG_INFO = YES; 311 | ONLY_ACTIVE_ARCH = YES; 312 | SDKROOT = iphoneos; 313 | }; 314 | name = Debug; 315 | }; 316 | 76C5F2481DC98B9A0004C70F /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | ALWAYS_SEARCH_USER_PATHS = NO; 320 | CLANG_ANALYZER_NONNULL = YES; 321 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 322 | CLANG_CXX_LIBRARY = "libc++"; 323 | CLANG_ENABLE_MODULES = YES; 324 | CLANG_ENABLE_OBJC_ARC = YES; 325 | CLANG_WARN_BOOL_CONVERSION = YES; 326 | CLANG_WARN_CONSTANT_CONVERSION = YES; 327 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 328 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 329 | CLANG_WARN_EMPTY_BODY = YES; 330 | CLANG_WARN_ENUM_CONVERSION = YES; 331 | CLANG_WARN_INFINITE_RECURSION = YES; 332 | CLANG_WARN_INT_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 335 | CLANG_WARN_UNREACHABLE_CODE = YES; 336 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 338 | COPY_PHASE_STRIP = NO; 339 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 340 | ENABLE_NS_ASSERTIONS = NO; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | GCC_C_LANGUAGE_STANDARD = gnu99; 343 | GCC_NO_COMMON_BLOCKS = YES; 344 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 345 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 346 | GCC_WARN_UNDECLARED_SELECTOR = YES; 347 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 348 | GCC_WARN_UNUSED_FUNCTION = YES; 349 | GCC_WARN_UNUSED_VARIABLE = YES; 350 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 351 | MTL_ENABLE_DEBUG_INFO = NO; 352 | SDKROOT = iphoneos; 353 | VALIDATE_PRODUCT = YES; 354 | }; 355 | name = Release; 356 | }; 357 | 76C5F24A1DC98B9A0004C70F /* Debug */ = { 358 | isa = XCBuildConfiguration; 359 | baseConfigurationReference = 32C339156C6DD30BBC6FBE75 /* Pods-JWDFMDB-Data.debug.xcconfig */; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | DEVELOPMENT_TEAM = HF526ANGZB; 363 | INFOPLIST_FILE = "JWDFMDB-Data/Info.plist"; 364 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 365 | PRODUCT_BUNDLE_IDENTIFIER = "com.yixia.JWDFMDB-Data"; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | }; 368 | name = Debug; 369 | }; 370 | 76C5F24B1DC98B9A0004C70F /* Release */ = { 371 | isa = XCBuildConfiguration; 372 | baseConfigurationReference = AC062C2909C5FFA78966B0A3 /* Pods-JWDFMDB-Data.release.xcconfig */; 373 | buildSettings = { 374 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 375 | DEVELOPMENT_TEAM = HF526ANGZB; 376 | INFOPLIST_FILE = "JWDFMDB-Data/Info.plist"; 377 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 378 | PRODUCT_BUNDLE_IDENTIFIER = "com.yixia.JWDFMDB-Data"; 379 | PRODUCT_NAME = "$(TARGET_NAME)"; 380 | }; 381 | name = Release; 382 | }; 383 | /* End XCBuildConfiguration section */ 384 | 385 | /* Begin XCConfigurationList section */ 386 | 76C5F22D1DC98B9A0004C70F /* Build configuration list for PBXProject "JWDFMDB-Data" */ = { 387 | isa = XCConfigurationList; 388 | buildConfigurations = ( 389 | 76C5F2471DC98B9A0004C70F /* Debug */, 390 | 76C5F2481DC98B9A0004C70F /* Release */, 391 | ); 392 | defaultConfigurationIsVisible = 0; 393 | defaultConfigurationName = Release; 394 | }; 395 | 76C5F2491DC98B9A0004C70F /* Build configuration list for PBXNativeTarget "JWDFMDB-Data" */ = { 396 | isa = XCConfigurationList; 397 | buildConfigurations = ( 398 | 76C5F24A1DC98B9A0004C70F /* Debug */, 399 | 76C5F24B1DC98B9A0004C70F /* Release */, 400 | ); 401 | defaultConfigurationIsVisible = 0; 402 | defaultConfigurationName = Release; 403 | }; 404 | /* End XCConfigurationList section */ 405 | }; 406 | rootObject = 76C5F22A1DC98B9A0004C70F /* Project object */; 407 | } 408 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcodeproj/project.xcworkspace/xcuserdata/jiangweidong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weidongjiang/JWDFMDB-Data-Message/f0d3da407e404eeb288154ed1351e8e0c90e8fd6/JWDFMDB-Data/JWDFMDB-Data.xcodeproj/project.xcworkspace/xcuserdata/jiangweidong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcodeproj/xcuserdata/jiangweidong.xcuserdatad/xcschemes/JWDFMDB-Data.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcodeproj/xcuserdata/jiangweidong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | JWDFMDB-Data.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 76C5F2311DC98B9A0004C70F 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcworkspace/xcuserdata/jiangweidong.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weidongjiang/JWDFMDB-Data-Message/f0d3da407e404eeb288154ed1351e8e0c90e8fd6/JWDFMDB-Data/JWDFMDB-Data.xcworkspace/xcuserdata/jiangweidong.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data.xcworkspace/xcuserdata/jiangweidong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 20 | 21 | 22 | 24 | 36 | 37 | 38 | 40 | 52 | 53 | 54 | 56 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/JWDFMDBChatMessageData.h: -------------------------------------------------------------------------------- 1 | // 2 | // JWDFMDBChatMessageData.h 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import 10 | @class JWDModel; 11 | 12 | @interface JWDFMDBChatMessageData : NSObject 13 | 14 | +(instancetype)shareChatMeaage; 15 | - (BOOL)openDB; 16 | - (BOOL)closeDB; 17 | - (BOOL)isOpend; 18 | 19 | /** 20 | 增 插入数据 21 | @param messageModel 消息模型 22 | @return 消息id 也就是主键 23 | */ 24 | - (int64_t)addNewMessageWithModel:(JWDModel *)messageModel; 25 | 26 | /** 27 | 删 根据id 删除数据 28 | @param messageID 消息id 29 | @return 是否删除成功 30 | */ 31 | - (BOOL)deleteMessageWithMessageID:(NSInteger)messageID; 32 | 33 | /** 34 | 改 35 | @param messageModel 数据模型 36 | 37 | @return 是否修改成功 38 | */ 39 | - (BOOL)updateMessageWithMessageModel:(JWDModel *)messageModel; 40 | /** 41 | 查 获取所有数据 42 | @param loginid 用户id , 可以多账号登录,获取不同的数据 43 | @param friendid 不同的聊天对象 44 | @param offset 查询数据起始位置 45 | @param limit 一次查询的最大个数,查询最新20条 offset=0,limit=20. 查询最新20-40条,offset=20,limit=20; 46 | 如果是 -1 表示获取从开始位置起的所有数据。 47 | 48 | @return 模型数组 49 | */ 50 | - (NSArray *)getAllMessageWithLoginID:(NSInteger)loginid friendid:(NSInteger)friendid offset:(NSInteger)offset limit:(NSInteger)limit; 51 | 52 | @end 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/JWDFMDBChatMessageData.m: -------------------------------------------------------------------------------- 1 | // 2 | // JWDFMDBChatMessageData.m 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import "JWDFMDBChatMessageData.h" 10 | #include 11 | #import 12 | #import "JWDModel.h" 13 | 14 | // 数据库名 15 | #define JWDFMDBChatName @"JWDFMDBChatMessageData.sqlite" 16 | 17 | // 数据库版本表 18 | #define JWDFMDBChatVersion @"JWDFMDBChat_version" 19 | 20 | // 数据库版本号 21 | static NSString *JWDFMDBChatVersion_num = @"1.0"; 22 | 23 | // 数据表名 24 | #define JWDFMDBChatMessageDataName @"JWDFMDBChat_Message" 25 | 26 | static JWDFMDBChatMessageData *chatMessageData = nil; 27 | 28 | 29 | @interface JWDFMDBChatMessageData () 30 | 31 | @property(nonatomic, strong)FMDatabase *database;//!< <#value#> 32 | 33 | @end 34 | 35 | 36 | 37 | 38 | @implementation JWDFMDBChatMessageData 39 | 40 | +(instancetype)shareChatMeaage { 41 | static dispatch_once_t onceToken; 42 | dispatch_once(&onceToken, ^{ 43 | chatMessageData = [[JWDFMDBChatMessageData alloc] init]; 44 | }); 45 | return chatMessageData; 46 | } 47 | 48 | - (instancetype)init { 49 | 50 | if(self == [super init]){ 51 | 52 | // 1.判断是否有数据库表 53 | if (NO == [[NSFileManager defaultManager] fileExistsAtPath:[JWDFMDBChatMessageData dataPath]]){ 54 | 55 | FMDatabase *database = [FMDatabase databaseWithPath:[JWDFMDBChatMessageData dataPath]]; 56 | self.database = database; 57 | 58 | // 创建表是否成功 59 | if(NO == [self createtable]){ 60 | return nil; 61 | } 62 | 63 | }else{// 已经有表,直接打开 64 | FMDatabase *database = [FMDatabase databaseWithPath:[JWDFMDBChatMessageData dataPath]]; 65 | self.database = database; 66 | if(NO == [self.database open]){ 67 | [self.database close]; 68 | }else{ 69 | 70 | // 2.是否升级版本号 71 | // 如果需要更新数据库,那么可以在这里对相应的表添加和删除字段 并且更改版本号 72 | NSString *updateGradeSql = [NSString stringWithFormat:@"alter table JWDFMDBChat_Message add age integer not null default -1"]; 73 | 74 | // 如果不需要更新,直接传递 nil 75 | [self updateGradeSql:nil newVersion:JWDFMDBChatVersion_num]; 76 | } 77 | } 78 | } 79 | return self; 80 | } 81 | 82 | 83 | - (BOOL)openDB { 84 | return [self.database open]; 85 | } 86 | - (BOOL)closeDB { 87 | return [self.database close]; 88 | } 89 | - (BOOL)isOpend { 90 | return [self.database goodConnection]; 91 | } 92 | 93 | /** 94 | 创建数据表的存储地址 95 | 96 | @return 返回之地 97 | */ 98 | +(NSString *)dataPath { 99 | NSString *document = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; 100 | return [document stringByAppendingPathComponent:JWDFMDBChatName]; 101 | 102 | } 103 | 104 | - (BOOL)createtable { 105 | 106 | [self.database open]; 107 | 108 | // 创建版本表 109 | { 110 | NSString *sql = [NSString stringWithFormat:@"create table 'JWDFMDBChat_version' ('id' integer primary key autoincrement, 'version' text not null default '0', 'updateDate' text not null default '')"]; 111 | if(NO == [self.database executeUpdate:sql]){ 112 | NSLog(@"创建JWDFMDBChat_version表失败"); 113 | [self.database close]; 114 | return NO; 115 | } 116 | 117 | // 创建版本号 118 | [self addNewVersion:JWDFMDBChatVersion_num]; 119 | } 120 | 121 | // 创建数据库显示表 122 | { 123 | NSString *sql = [NSString stringWithFormat:@"create table 'JWDFMDBChat_Message' ('messageid' integer primary key autoincrement, 'loginid' intger default -1, 'friendid' integer default -1, 'message' text default '', 'messagetype' integer default -1, 'readStatus' integer default -1, 'sendStatus' integer default -1,'cureatetime' double default -1)"]; 124 | 125 | if(NO == [self.database executeUpdate:sql]){ 126 | NSLog(@"创建JWDFMDBChat_Message表失败"); 127 | [self.database close]; 128 | return NO; 129 | } 130 | 131 | } 132 | 133 | [self.database close]; 134 | return YES; 135 | } 136 | 137 | 138 | /** 139 | 添加版本号 140 | 141 | @param version <#version description#> 142 | 143 | @return <#return value description#> 144 | */ 145 | - (BOOL)addNewVersion:(NSString*)version{ 146 | 147 | NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 148 | [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss-zzz"]; 149 | NSString *datestring = [dateFormatter stringFromDate:[NSDate date]]; 150 | 151 | NSString *sql = [NSString stringWithFormat:@"insert into %@ (version, updateDate) values ('%@','%@')",JWDFMDBChatVersion,version,datestring]; 152 | 153 | 154 | return [self.database executeUpdate:sql]; 155 | } 156 | 157 | /** 158 | 更新数据库版本 159 | 1、版本低更新插入新的版本,2、版本一样不需要更新 3、没有记录版本,更新插入 160 | 161 | @param updateGradeSql 需要执行的 添加字段的版本号 162 | @param newVersion 新的版本号 163 | 164 | @return 是否更新成功 165 | */ 166 | - (BOOL)updateGradeSql:(NSString *)updateGradeSql newVersion:(NSString *)newVersion { 167 | 168 | // 不需要更新 169 | if (nil == updateGradeSql){ 170 | return YES; 171 | }else {// 需要更新 172 | NSString *spl = [NSString stringWithFormat:@"select * from %@ order by id desc limit 0,1",JWDFMDBChatVersion]; 173 | FMResultSet *set = [self.database executeQuery:spl]; 174 | CGFloat lastversion = -1.0; 175 | while ([set next]) { 176 | lastversion = [[set stringForColumn:@"version"] floatValue]; 177 | if ([newVersion floatValue] > lastversion){ 178 | // 执行更新数据库版本 179 | if([self.database executeUpdate:updateGradeSql]){ 180 | return [self addNewVersion:newVersion]; 181 | } 182 | } 183 | } 184 | // 没有记录版本号,需要更新 185 | if (lastversion == -1) { 186 | if([self.database executeUpdate:updateGradeSql]){ 187 | return [self addNewVersion:newVersion]; 188 | } 189 | } 190 | } 191 | return YES; 192 | } 193 | 194 | #pragma mark - 195 | #pragma mark - 增 删 改 查 196 | /** 197 | 增 插入数据 198 | 199 | @param messageModel 消息模型 200 | 201 | @return 消息id 也就是主键 202 | */ 203 | - (int64_t)addNewMessageWithModel:(JWDModel *)messageModel { 204 | 205 | if(nil == messageModel){ 206 | return NO; 207 | } 208 | 209 | if(nil == messageModel.message){ 210 | messageModel.message = @""; 211 | } 212 | 213 | // 方式1 214 | // NSString *sql = [NSString stringWithFormat:@"insert into %@ (loginid,friendid,message,messagetype,readStatus,sendStatus,cureatetime) values (%0ld,%0ld,'%@',%0ld,%0ld,%0ld,%f)",JWDFMDBChatMessageDataName,(long)messageModel.loginid,(long)messageModel.friendid,messageModel.message,(long)messageModel.messagetype,(long)messageModel.readStatus,(long)messageModel.sendStatus,messageModel.cureatetime]; 215 | // 216 | // if ([self.database executeUpdate:sql]){ 217 | // 218 | // return self.database.lastInsertRowId; 219 | // 220 | // }else{ 221 | // 222 | // NSLog(@"插入数据出错 %@",self.database.lastErrorMessage); 223 | // return -1; 224 | // } 225 | 226 | // 方式2 当方式1 中插入的数据有特殊的字符是,就会数据写入失败,使用方式2可以完美解决这一问题。 227 | NSString *sql = [NSString stringWithFormat:@"insert into %@ (loginid,friendid,message,messagetype,readStatus,sendStatus,cureatetime) values (?,?,?,?,?,?,?)",JWDFMDBChatMessageDataName]; 228 | 229 | NSNumber *loginid = [NSNumber numberWithInteger:(long)messageModel.loginid]; 230 | NSNumber *friendid = [NSNumber numberWithInteger:(long)messageModel.friendid]; 231 | NSString *message = [NSString stringWithString:messageModel.message]; 232 | NSNumber *messagetype = [NSNumber numberWithInteger:(long)messageModel.messagetype]; 233 | NSNumber *readStatus = [NSNumber numberWithInteger:(long)messageModel.readStatus]; 234 | NSNumber *sendStatus = [NSNumber numberWithInteger:(long)messageModel.sendStatus]; 235 | NSNumber *cureatetime = [NSNumber numberWithFloat:messageModel.cureatetime]; 236 | 237 | if ([self.database executeUpdate:sql withArgumentsInArray:@[loginid,friendid,message,messagetype,readStatus,sendStatus,cureatetime]]){ 238 | return self.database.lastInsertRowId; 239 | }else{ 240 | 241 | NSLog(@"插入数据出错 %@",self.database.lastErrorMessage); 242 | return -1; 243 | } 244 | } 245 | /** 246 | 删 根据id 删除数据 247 | 248 | @param messageID 消息id 249 | 250 | @return 是否删除成功 251 | */ 252 | - (BOOL)deleteMessageWithMessageID:(NSInteger)messageID { 253 | 254 | NSString *sql = [NSString stringWithFormat:@"delete from %@ where messageid=%0ld",JWDFMDBChatMessageDataName,(long)messageID]; 255 | return [self.database executeUpdate:sql]; 256 | } 257 | 258 | /** 259 | 改 260 | 261 | @param messageModel 数据模型 262 | 263 | @return 是否修改成功 264 | */ 265 | 266 | - (BOOL)updateMessageWithMessageModel:(JWDModel *)messageModel{ 267 | 268 | NSString *sql = [NSString stringWithFormat:@"update %@ set loginid=?,friendid=?,message=?,messagetype=?,readStatus=?,sendStatus=?,cureatetime=? where messageid=?",JWDFMDBChatMessageDataName]; 269 | 270 | NSNumber *loginid = [NSNumber numberWithInteger:(long)messageModel.loginid]; 271 | NSNumber *friendid = [NSNumber numberWithInteger:(long)messageModel.friendid]; 272 | NSString *message = [NSString stringWithString:messageModel.message]; 273 | NSNumber *messagetype = [NSNumber numberWithInteger:(long)messageModel.messagetype]; 274 | NSNumber *readStatus = [NSNumber numberWithInteger:(long)messageModel.readStatus]; 275 | NSNumber *sendStatus = [NSNumber numberWithInteger:(long)messageModel.sendStatus]; 276 | NSNumber *cureatetime = [NSNumber numberWithFloat:messageModel.cureatetime]; 277 | NSNumber *messageid = [NSNumber numberWithInteger:(long)messageModel.messageid]; 278 | 279 | BOOL isupdate = [self.database executeUpdate:sql withArgumentsInArray:@[loginid,friendid,message,messagetype,readStatus,sendStatus,cureatetime,messageid]]; 280 | 281 | return isupdate; 282 | 283 | } 284 | /** 285 | 查 获取所有数据 286 | @param loginid 用户id , 可以多账号登录,获取不同的数据 287 | @param friendid 不同的聊天对象 288 | @param offset 数据起始位置 289 | @param limit 查询的个数 290 | @return 模型数组 291 | */ 292 | - (NSArray *)getAllMessageWithLoginID:(NSInteger)loginid friendid:(NSInteger)friendid offset:(NSInteger)offset limit:(NSInteger)limit { 293 | 294 | if (loginid<=0 || friendid<=0){ 295 | NSLog(@"参数 id 不对"); 296 | return nil; 297 | } 298 | 299 | NSString *sql = [NSString stringWithFormat:@"select * from (select * from %@ where loginid=%ld and friendid=%ld order by cureatetime desc limit %ld offset %ld) order by cureatetime",JWDFMDBChatMessageDataName,loginid,friendid,limit,offset]; 300 | NSMutableArray *data = [NSMutableArray array]; 301 | FMResultSet *set = [self.database executeQuery:sql]; 302 | while ([set next]) { 303 | JWDModel *model = [[JWDModel alloc] init]; 304 | model.messageid = [set intForColumn:@"messageid"]; 305 | model.loginid = [set intForColumn:@"loginid"]; 306 | model.friendid = [set intForColumn:@"friendid"]; 307 | model.message = [set stringForColumn:@"message"]; 308 | model.messagetype = [set intForColumn:@"messagetype"]; 309 | model.readStatus = [set intForColumn:@"readStatus"]; 310 | model.sendStatus = [set intForColumn:@"sendStatus"]; 311 | model.cureatetime = [set doubleForColumn:@"cureatetime"]; 312 | [data addObject:model]; 313 | } 314 | if (data.count>0){ 315 | return [NSArray arrayWithArray:data]; 316 | }else{ 317 | return nil; 318 | } 319 | } 320 | @end 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/JWDModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // JWDModel.h 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JWDModel : NSObject 12 | 13 | //@"create table 'JWDFMDBChat_Message' ('messageid' integer primary key autoincrement, 'loginid' intger default -1, 'friendid' integer default -1, 'message' text default '', 'messagetype' integer default -1, 'readStatus' integer default -1, 'sendStatus' integer default -1,'cureatetime' double default -1)" 14 | 15 | @property (nonatomic, assign) NSInteger messageid;//!< 消息id 16 | @property (nonatomic, assign) NSInteger loginid;//!< 登陆者id 17 | @property (nonatomic, assign) NSInteger friendid;//!< 聊天对方id 18 | @property (nonatomic, strong) NSString *message;//!< 消息体 19 | @property (nonatomic, assign) NSInteger messagetype;//!< 消息类型 20 | @property (nonatomic, assign) NSInteger readStatus;//!< 消息 已读与未读 21 | @property (nonatomic, assign) NSInteger sendStatus;//!< 消息 发送成功或失败 22 | @property (nonatomic, assign) double cureatetime;//!< 消息 发送或接受时间 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/JWDModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // JWDModel.m 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import "JWDModel.h" 10 | 11 | @implementation JWDModel 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/Podfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weidongjiang/JWDFMDB-Data-Message/f0d3da407e404eeb288154ed1351e8e0c90e8fd6/JWDFMDB-Data/JWDFMDB-Data/Podfile -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "JWDFMDBChatMessageData.h" 11 | #import "JWDModel.h" 12 | 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | 22 | [[JWDFMDBChatMessageData shareChatMeaage] openDB]; 23 | 24 | UIButton *addbtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 100, 80, 40)]; 25 | addbtn.backgroundColor = [UIColor greenColor]; 26 | addbtn.titleLabel.font = [UIFont systemFontOfSize:12]; 27 | [addbtn setTitle:@"插入数据" forState:UIControlStateNormal]; 28 | [addbtn addTarget:self action:@selector(addbtnDid) forControlEvents:UIControlEventTouchUpInside]; 29 | [self.view addSubview:addbtn]; 30 | 31 | UIButton *delebtn = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 80, 40)]; 32 | delebtn.backgroundColor = [UIColor greenColor]; 33 | delebtn.titleLabel.font = [UIFont systemFontOfSize:12]; 34 | [delebtn setTitle:@"删除数据" forState:UIControlStateNormal]; 35 | [delebtn addTarget:self action:@selector(delebtnDid) forControlEvents:UIControlEventTouchUpInside]; 36 | [self.view addSubview:delebtn]; 37 | 38 | UIButton *updatebtn = [[UIButton alloc] initWithFrame:CGRectMake(10, 200, 80, 40)]; 39 | updatebtn.backgroundColor = [UIColor greenColor]; 40 | updatebtn.titleLabel.font = [UIFont systemFontOfSize:12]; 41 | [updatebtn setTitle:@"修改数据" forState:UIControlStateNormal]; 42 | [updatebtn addTarget:self action:@selector(updatebtnDid) forControlEvents:UIControlEventTouchUpInside]; 43 | [self.view addSubview:updatebtn]; 44 | 45 | UIButton *getDatabtn = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 80, 40)]; 46 | getDatabtn.backgroundColor = [UIColor greenColor]; 47 | getDatabtn.titleLabel.font = [UIFont systemFontOfSize:12]; 48 | [getDatabtn setTitle:@"获取全部数据" forState:UIControlStateNormal]; 49 | [getDatabtn addTarget:self action:@selector(getDatabtnDid) forControlEvents:UIControlEventTouchUpInside]; 50 | [self.view addSubview:getDatabtn]; 51 | 52 | } 53 | 54 | -(void)addbtnDid { 55 | 56 | JWDModel *model = [[JWDModel alloc] init]; 57 | model.loginid = 679790; 58 | model.friendid = 13314; 59 | model.message = [NSString stringWithFormat:@"'"]; 60 | model.messagetype = 1; 61 | model.readStatus = 0; 62 | model.sendStatus = 1; 63 | model.cureatetime = 2698798713; 64 | 65 | int64_t messageid = [[JWDFMDBChatMessageData shareChatMeaage] addNewMessageWithModel:model]; 66 | if (-1 != messageid){ 67 | NSLog(@"数据插入成功 消息id %lld",messageid); 68 | } 69 | } 70 | 71 | 72 | - (void)delebtnDid { 73 | 74 | BOOL isdele = [[JWDFMDBChatMessageData shareChatMeaage] deleteMessageWithMessageID:10]; 75 | NSLog(@"isdele -- %d",isdele?1:0); 76 | } 77 | 78 | - (void)updatebtnDid { 79 | 80 | JWDModel *model = [[JWDModel alloc] init]; 81 | 82 | model.messageid = 21; 83 | model.loginid = 1111111111; 84 | model.friendid = 222222222; 85 | model.message = [NSString stringWithFormat:@"我在跟进,完毕,iiiii"]; 86 | model.messagetype = 1; 87 | model.readStatus = 0; 88 | model.sendStatus = 1; 89 | model.cureatetime = 80808089899; 90 | 91 | BOOL isupdate = [[JWDFMDBChatMessageData shareChatMeaage] updateMessageWithMessageModel:model]; 92 | NSLog(@"isupdate -- %d",isupdate?1:0); 93 | 94 | } 95 | - (void)getDatabtnDid { 96 | 97 | 98 | NSArray *data = [[JWDFMDBChatMessageData shareChatMeaage] getAllMessageWithLoginID:679790 friendid:13314 offset:0 limit:100]; 99 | 100 | NSLog(@"data count %lu",(unsigned long)data.count); 101 | } 102 | 103 | - (void)dealloc { 104 | 105 | [[JWDFMDBChatMessageData shareChatMeaage] closeDB]; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /JWDFMDB-Data/JWDFMDB-Data/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JWDFMDB-Data 4 | // 5 | // Created by 蒋伟东 on 2016/11/2. 6 | // Copyright © 2016年 YIXIA. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'JWDFMDB-Data' do 5 | # Uncomment this line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | 8 | # Pods for JWDFMDB-Data 9 | 10 | end 11 | 12 | 13 | pod ‘FMDB’ 14 | 15 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FMDB (2.6.2): 3 | - FMDB/standard (= 2.6.2) 4 | - FMDB/standard (2.6.2) 5 | 6 | DEPENDENCIES: 7 | - FMDB 8 | 9 | SPEC CHECKSUMS: 10 | FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a 11 | 12 | PODFILE CHECKSUM: 7b974b2a722b0021c3858ec7235c91cc0e29bbf3 13 | 14 | COCOAPODS: 1.0.1 15 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/LICENSE.txt: -------------------------------------------------------------------------------- 1 | If you are using FMDB in your project, I'd love to hear about it. Let Gus know 2 | by sending an email to gus@flyingmeat.com. 3 | 4 | And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you 5 | might consider purchasing a drink of their choosing if FMDB has been useful to 6 | you. 7 | 8 | Finally, and shortly, this is the MIT License. 9 | 10 | Copyright (c) 2008-2014 Flying Meat Inc. 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be included in 20 | all copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 28 | THE SOFTWARE. -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/README.markdown: -------------------------------------------------------------------------------- 1 | # FMDB v2.6.2 2 | 3 | This is an Objective-C wrapper around SQLite: http://sqlite.org/ 4 | 5 | ## The FMDB Mailing List: 6 | http://groups.google.com/group/fmdb 7 | 8 | ## Read the SQLite FAQ: 9 | http://www.sqlite.org/faq.html 10 | 11 | Since FMDB is built on top of SQLite, you're going to want to read this page top to bottom at least once. And while you're there, make sure to bookmark the SQLite Documentation page: http://www.sqlite.org/docs.html 12 | 13 | ## Contributing 14 | Do you have an awesome idea that deserves to be in FMDB? You might consider pinging ccgus first to make sure he hasn't already ruled it out for some reason. Otherwise pull requests are great, and make sure you stick to the local coding conventions. However, please be patient and if you haven't heard anything from ccgus for a week or more, you might want to send a note asking what's up. 15 | 16 | ## CocoaPods 17 | 18 | [![Dependency Status](https://www.versioneye.com/objective-c/fmdb/2.3/badge.svg?style=flat)](https://www.versioneye.com/objective-c/fmdb/2.3) 19 | [![Reference Status](https://www.versioneye.com/objective-c/fmdb/reference_badge.svg?style=flat)](https://www.versioneye.com/objective-c/fmdb/references) 20 | 21 | FMDB can be installed using [CocoaPods](https://cocoapods.org/). 22 | 23 | ``` 24 | pod 'FMDB' 25 | # pod 'FMDB/FTS' # FMDB with FTS 26 | # pod 'FMDB/standalone' # FMDB with latest SQLite amalgamation source 27 | # pod 'FMDB/standalone/FTS' # FMDB with latest SQLite amalgamation source and FTS 28 | # pod 'FMDB/SQLCipher' # FMDB with SQLCipher 29 | ``` 30 | 31 | **If using FMDB with [SQLCipher](https://www.zetetic.net/sqlcipher/) you must use the FMDB/SQLCipher subspec. The FMDB/SQLCipher subspec declares SQLCipher as a dependency, allowing FMDB to be compiled with the `-DSQLITE_HAS_CODEC` flag.** 32 | 33 | ## FMDB Class Reference: 34 | http://ccgus.github.io/fmdb/html/index.html 35 | 36 | ## Automatic Reference Counting (ARC) or Manual Memory Management? 37 | You can use either style in your Cocoa project. FMDB will figure out which you are using at compile time and do the right thing. 38 | 39 | ## Usage 40 | There are three main classes in FMDB: 41 | 42 | 1. `FMDatabase` - Represents a single SQLite database. Used for executing SQL statements. 43 | 2. `FMResultSet` - Represents the results of executing a query on an `FMDatabase`. 44 | 3. `FMDatabaseQueue` - If you're wanting to perform queries and updates on multiple threads, you'll want to use this class. It's described in the "Thread Safety" section below. 45 | 46 | ### Database Creation 47 | An `FMDatabase` is created with a path to a SQLite database file. This path can be one of these three: 48 | 49 | 1. A file system path. The file does not have to exist on disk. If it does not exist, it is created for you. 50 | 2. An empty string (`@""`). An empty database is created at a temporary location. This database is deleted with the `FMDatabase` connection is closed. 51 | 3. `NULL`. An in-memory database is created. This database will be destroyed with the `FMDatabase` connection is closed. 52 | 53 | (For more information on temporary and in-memory databases, read the sqlite documentation on the subject: http://www.sqlite.org/inmemorydb.html) 54 | 55 | ```objc 56 | FMDatabase *db = [FMDatabase databaseWithPath:@"/tmp/tmp.db"]; 57 | ``` 58 | 59 | ### Opening 60 | 61 | Before you can interact with the database, it must be opened. Opening fails if there are insufficient resources or permissions to open and/or create the database. 62 | 63 | ```objc 64 | if (![db open]) { 65 | [db release]; 66 | return; 67 | } 68 | ``` 69 | 70 | ### Executing Updates 71 | 72 | Any sort of SQL statement which is not a `SELECT` statement qualifies as an update. This includes `CREATE`, `UPDATE`, `INSERT`, `ALTER`, `COMMIT`, `BEGIN`, `DETACH`, `DELETE`, `DROP`, `END`, `EXPLAIN`, `VACUUM`, and `REPLACE` statements (plus many more). Basically, if your SQL statement does not begin with `SELECT`, it is an update statement. 73 | 74 | Executing updates returns a single value, a `BOOL`. A return value of `YES` means the update was successfully executed, and a return value of `NO` means that some error was encountered. You may invoke the `-lastErrorMessage` and `-lastErrorCode` methods to retrieve more information. 75 | 76 | ### Executing Queries 77 | 78 | A `SELECT` statement is a query and is executed via one of the `-executeQuery...` methods. 79 | 80 | Executing queries returns an `FMResultSet` object if successful, and `nil` upon failure. You should use the `-lastErrorMessage` and `-lastErrorCode` methods to determine why a query failed. 81 | 82 | In order to iterate through the results of your query, you use a `while()` loop. You also need to "step" from one record to the other. With FMDB, the easiest way to do that is like this: 83 | 84 | ```objc 85 | FMResultSet *s = [db executeQuery:@"SELECT * FROM myTable"]; 86 | while ([s next]) { 87 | //retrieve values for each record 88 | } 89 | ``` 90 | 91 | You must always invoke `-[FMResultSet next]` before attempting to access the values returned in a query, even if you're only expecting one: 92 | 93 | ```objc 94 | FMResultSet *s = [db executeQuery:@"SELECT COUNT(*) FROM myTable"]; 95 | if ([s next]) { 96 | int totalCount = [s intForColumnIndex:0]; 97 | } 98 | ``` 99 | 100 | `FMResultSet` has many methods to retrieve data in an appropriate format: 101 | 102 | - `intForColumn:` 103 | - `longForColumn:` 104 | - `longLongIntForColumn:` 105 | - `boolForColumn:` 106 | - `doubleForColumn:` 107 | - `stringForColumn:` 108 | - `dateForColumn:` 109 | - `dataForColumn:` 110 | - `dataNoCopyForColumn:` 111 | - `UTF8StringForColumnName:` 112 | - `objectForColumnName:` 113 | 114 | Each of these methods also has a `{type}ForColumnIndex:` variant that is used to retrieve the data based on the position of the column in the results, as opposed to the column's name. 115 | 116 | Typically, there's no need to `-close` an `FMResultSet` yourself, since that happens when either the result set is deallocated, or the parent database is closed. 117 | 118 | ### Closing 119 | 120 | When you have finished executing queries and updates on the database, you should `-close` the `FMDatabase` connection so that SQLite will relinquish any resources it has acquired during the course of its operation. 121 | 122 | ```objc 123 | [db close]; 124 | ``` 125 | 126 | ### Transactions 127 | 128 | `FMDatabase` can begin and commit a transaction by invoking one of the appropriate methods or executing a begin/end transaction statement. 129 | 130 | ### Multiple Statements and Batch Stuff 131 | 132 | You can use `FMDatabase`'s executeStatements:withResultBlock: to do multiple statements in a string: 133 | 134 | ```objc 135 | NSString *sql = @"create table bulktest1 (id integer primary key autoincrement, x text);" 136 | "create table bulktest2 (id integer primary key autoincrement, y text);" 137 | "create table bulktest3 (id integer primary key autoincrement, z text);" 138 | "insert into bulktest1 (x) values ('XXX');" 139 | "insert into bulktest2 (y) values ('YYY');" 140 | "insert into bulktest3 (z) values ('ZZZ');"; 141 | 142 | success = [db executeStatements:sql]; 143 | 144 | sql = @"select count(*) as count from bulktest1;" 145 | "select count(*) as count from bulktest2;" 146 | "select count(*) as count from bulktest3;"; 147 | 148 | success = [self.db executeStatements:sql withResultBlock:^int(NSDictionary *dictionary) { 149 | NSInteger count = [dictionary[@"count"] integerValue]; 150 | XCTAssertEqual(count, 1, @"expected one record for dictionary %@", dictionary); 151 | return 0; 152 | }]; 153 | ``` 154 | 155 | ### Data Sanitization 156 | 157 | When providing a SQL statement to FMDB, you should not attempt to "sanitize" any values before insertion. Instead, you should use the standard SQLite binding syntax: 158 | 159 | ```sql 160 | INSERT INTO myTable VALUES (?, ?, ?, ?) 161 | ``` 162 | 163 | The `?` character is recognized by SQLite as a placeholder for a value to be inserted. The execution methods all accept a variable number of arguments (or a representation of those arguments, such as an `NSArray`, `NSDictionary`, or a `va_list`), which are properly escaped for you. 164 | 165 | And, to use that SQL with the `?` placeholders from Objective-C: 166 | 167 | ```objc 168 | NSInteger identifier = 42; 169 | NSString *name = @"Liam O'Flaherty (\"the famous Irish author\")"; 170 | NSDate *date = [NSDate date]; 171 | NSString *comment = nil; 172 | 173 | BOOL success = [db executeUpdate:@"INSERT INTO authors (identifier, name, date, comment) VALUES (?, ?, ?, ?)", @(identifier), name, date, comment ?: [NSNull null]]; 174 | if (!success) { 175 | NSLog(@"error = %@", [db lastErrorMessage]); 176 | } 177 | ``` 178 | 179 | > **Note:** Fundamental data types, like the `NSInteger` variable `identifier`, should be as a `NSNumber` objects, achieved by using the `@` syntax, shown above. Or you can use the `[NSNumber numberWithInt:identifier]` syntax, too. 180 | > 181 | > Likewise, SQL `NULL` values should be inserted as `[NSNull null]`. For example, in the case of `comment` which might be `nil` (and is in this example), you can use the `comment ?: [NSNull null]` syntax, which will insert the string if `comment` is not `nil`, but will insert `[NSNull null]` if it is `nil`. 182 | 183 | In Swift, you would use `executeUpdate(values:)`, which not only is a concise Swift syntax, but also `throws` errors for proper Swift 2 error handling: 184 | 185 | ```swift 186 | do { 187 | let identifier = 42 188 | let name = "Liam O'Flaherty (\"the famous Irish author\")" 189 | let date = NSDate() 190 | let comment: String? = nil 191 | 192 | try db.executeUpdate("INSERT INTO authors (identifier, name, date, comment) VALUES (?, ?, ?, ?)", values: [identifier, name, date, comment ?? NSNull()]) 193 | } catch { 194 | print("error = \(error)") 195 | } 196 | ``` 197 | 198 | > **Note:** In Swift, you don't have to wrap fundamental numeric types like you do in Objective-C. But if you are going to insert an optional string, you would probably use the `comment ?? NSNull()` syntax (i.e., if it is `nil`, use `NSNull`, otherwise use the string). 199 | 200 | Alternatively, you may use named parameters syntax: 201 | 202 | ```sql 203 | INSERT INTO authors (identifier, name, date, comment) VALUES (:identifier, :name, :date, :comment) 204 | ``` 205 | 206 | The parameters *must* start with a colon. SQLite itself supports other characters, but internally the dictionary keys are prefixed with a colon, do **not** include the colon in your dictionary keys. 207 | 208 | ```objc 209 | NSDictionary *arguments = @{@"identifier": @(identifier), @"name": name, @"date": date, @"comment": comment ?: [NSNull null]}; 210 | BOOL success = [db executeUpdate:@"INSERT INTO authors (identifier, name, date, comment) VALUES (:identifier, :name, :date, :comment)" withParameterDictionary:arguments]; 211 | if (!success) { 212 | NSLog(@"error = %@", [db lastErrorMessage]); 213 | } 214 | ``` 215 | 216 | The key point is that one should not use `NSString` method `stringWithFormat` to manually insert values into the SQL statement, itself. Nor should one Swift string interpolation to insert values into the SQL. Use `?` placeholders for values to be inserted into the database (or used in `WHERE` clauses in `SELECT` statements). 217 | 218 |

Using FMDatabaseQueue and Thread Safety.

219 | 220 | Using a single instance of `FMDatabase` from multiple threads at once is a bad idea. It has always been OK to make a `FMDatabase` object *per thread*. Just don't share a single instance across threads, and definitely not across multiple threads at the same time. Bad things will eventually happen and you'll eventually get something to crash, or maybe get an exception, or maybe meteorites will fall out of the sky and hit your Mac Pro. *This would suck*. 221 | 222 | **So don't instantiate a single `FMDatabase` object and use it across multiple threads.** 223 | 224 | Instead, use `FMDatabaseQueue`. Instantiate a single `FMDatabaseQueue` and use it across multiple threads. The `FMDatabaseQueue` object will synchronize and coordinate access across the multiple threads. Here's how to use it: 225 | 226 | First, make your queue. 227 | 228 | ```objc 229 | FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath]; 230 | ``` 231 | 232 | Then use it like so: 233 | 234 | 235 | ```objc 236 | [queue inDatabase:^(FMDatabase *db) { 237 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @1]; 238 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @2]; 239 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @3]; 240 | 241 | FMResultSet *rs = [db executeQuery:@"select * from foo"]; 242 | while ([rs next]) { 243 | … 244 | } 245 | }]; 246 | ``` 247 | 248 | An easy way to wrap things up in a transaction can be done like this: 249 | 250 | ```objc 251 | [queue inTransaction:^(FMDatabase *db, BOOL *rollback) { 252 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @1]; 253 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @2]; 254 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @3]; 255 | 256 | if (whoopsSomethingWrongHappened) { 257 | *rollback = YES; 258 | return; 259 | } 260 | // etc… 261 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", @4]; 262 | }]; 263 | ``` 264 | 265 | The Swift equivalent would be: 266 | 267 | ```swift 268 | queue.inTransaction { db, rollback in 269 | do { 270 | try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [1]) 271 | try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [2]) 272 | try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [3]) 273 | 274 | if whoopsSomethingWrongHappened { 275 | rollback.memory = true 276 | return 277 | } 278 | 279 | try db.executeUpdate("INSERT INTO myTable VALUES (?)", values: [4]) 280 | } catch { 281 | rollback.memory = true 282 | print(error) 283 | } 284 | } 285 | ``` 286 | 287 | `FMDatabaseQueue` will run the blocks on a serialized queue (hence the name of the class). So if you call `FMDatabaseQueue`'s methods from multiple threads at the same time, they will be executed in the order they are received. This way queries and updates won't step on each other's toes, and every one is happy. 288 | 289 | **Note:** The calls to `FMDatabaseQueue`'s methods are blocking. So even though you are passing along blocks, they will **not** be run on another thread. 290 | 291 | ## Making custom sqlite functions, based on blocks. 292 | 293 | You can do this! For an example, look for `-makeFunctionNamed:` in main.m 294 | 295 | ## Swift 296 | 297 | You can use FMDB in Swift projects too. 298 | 299 | To do this, you must: 300 | 301 | 1. Copy the relevant `.m` and `.h` files from the FMDB `src` folder into your project. 302 | 303 | You can copy all of them (which is easiest), or only the ones you need. Likely you will need [`FMDatabase`](http://ccgus.github.io/fmdb/html/Classes/FMDatabase.html) and [`FMResultSet`](http://ccgus.github.io/fmdb/html/Classes/FMResultSet.html) at a minimum. [`FMDatabaseAdditions`](http://ccgus.github.io/fmdb/html/Categories/FMDatabase+FMDatabaseAdditions.html) provides some very useful convenience methods, so you will likely want that, too. If you are doing multithreaded access to a database, [`FMDatabaseQueue`](http://ccgus.github.io/fmdb/html/Classes/FMDatabaseQueue.html) is quite useful, too. If you choose to not copy all of the files from the `src` directory, though, you may want to update `FMDB.h` to only reference the files that you included in your project. 304 | 305 | Note, if you're copying all of the files from the `src` folder into to your project (which is recommended), you may want to drag the individual files into your project, not the folder, itself, because if you drag the folder, you won't be prompted to add the bridging header (see next point). 306 | 307 | 2. If prompted to create a "bridging header", you should do so. If not prompted and if you don't already have a bridging header, add one. 308 | 309 | For more information on bridging headers, see [Swift and Objective-C in the Same Project](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html#//apple_ref/doc/uid/TP40014216-CH10-XID_76). 310 | 311 | 3. In your bridging header, add a line that says: 312 | ```objc 313 | #import "FMDB.h" 314 | ``` 315 | 316 | 4. Use the variations of `executeQuery` and `executeUpdate` with the `sql` and `values` parameters with `try` pattern, as shown below. These renditions of `executeQuery` and `executeUpdate` both `throw` errors in true Swift 2 fashion. 317 | 318 | If you do the above, you can then write Swift code that uses `FMDatabase`. For example: 319 | 320 | ```swift 321 | let documents = try! NSFileManager.defaultManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: false) 322 | let fileURL = documents.URLByAppendingPathComponent("test.sqlite") 323 | 324 | let database = FMDatabase(path: fileURL.path) 325 | 326 | if !database.open() { 327 | print("Unable to open database") 328 | return 329 | } 330 | 331 | do { 332 | try database.executeUpdate("create table test(x text, y text, z text)", values: nil) 333 | try database.executeUpdate("insert into test (x, y, z) values (?, ?, ?)", values: ["a", "b", "c"]) 334 | try database.executeUpdate("insert into test (x, y, z) values (?, ?, ?)", values: ["e", "f", "g"]) 335 | 336 | let rs = try database.executeQuery("select x, y, z from test", values: nil) 337 | while rs.next() { 338 | let x = rs.stringForColumn("x") 339 | let y = rs.stringForColumn("y") 340 | let z = rs.stringForColumn("z") 341 | print("x = \(x); y = \(y); z = \(z)") 342 | } 343 | } catch let error as NSError { 344 | print("failed: \(error.localizedDescription)") 345 | } 346 | 347 | database.close() 348 | ``` 349 | 350 | ## History 351 | 352 | The history and changes are availbe on its [GitHub page](https://github.com/ccgus/fmdb) and are summarized in the "CHANGES_AND_TODO_LIST.txt" file. 353 | 354 | ## Contributors 355 | 356 | The contributors to FMDB are contained in the "Contributors.txt" file. 357 | 358 | ## Additional projects using FMDB, which might be interesting to the discerning developer. 359 | 360 | * FMDBMigrationManager, A SQLite schema migration management system for FMDB: https://github.com/layerhq/FMDBMigrationManager 361 | * FCModel, An alternative to Core Data for people who like having direct SQL access: https://github.com/marcoarment/FCModel 362 | 363 | ## Quick notes on FMDB's coding style 364 | 365 | Spaces, not tabs. Square brackets, not dot notation. Look at what FMDB already does with curly brackets and such, and stick to that style. 366 | 367 | ## Reporting bugs 368 | 369 | Reduce your bug down to the smallest amount of code possible. You want to make it super easy for the developers to see and reproduce your bug. If it helps, pretend that the person who can fix your bug is active on shipping 3 major products, works on a handful of open source projects, has a newborn baby, and is generally very very busy. 370 | 371 | And we've even added a template function to main.m (FMDBReportABugFunction) in the FMDB distribution to help you out: 372 | 373 | * Open up fmdb project in Xcode. 374 | * Open up main.m and modify the FMDBReportABugFunction to reproduce your bug. 375 | * Setup your table(s) in the code. 376 | * Make your query or update(s). 377 | * Add some assertions which demonstrate the bug. 378 | 379 | Then you can bring it up on the FMDB mailing list by showing your nice and compact FMDBReportABugFunction, or you can report the bug via the github FMDB bug reporter. 380 | 381 | **Optional:** 382 | 383 | Figure out where the bug is, fix it, and send a patch in or bring that up on the mailing list. Make sure all the other tests run after your modifications. 384 | 385 | ## Support 386 | 387 | The support channels for FMDB are the mailing list (see above), filing a bug here, or maybe on Stack Overflow. So that is to say, support is provided by the community and on a voluntary basis. 388 | 389 | FMDB development is overseen by Gus Mueller of Flying Meat. If FMDB been helpful to you, consider purchasing an app from FM or telling all your friends about it. 390 | 391 | ## License 392 | 393 | The license for FMDB is contained in the "License.txt" file. 394 | 395 | If you happen to come across either Gus Mueller or Rob Ryan in a bar, you might consider purchasing a drink of their choosing if FMDB has been useful to you. 396 | 397 | (The drink is for them of course, shame on you for trying to keep it.) 398 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDB.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double FMDBVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char FMDBVersionString[]; 5 | 6 | #import "FMDatabase.h" 7 | #import "FMResultSet.h" 8 | #import "FMDatabaseAdditions.h" 9 | #import "FMDatabaseQueue.h" 10 | #import "FMDatabasePool.h" 11 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabaseAdditions.h 3 | // fmdb 4 | // 5 | // Created by August Mueller on 10/30/05. 6 | // Copyright 2005 Flying Meat Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FMDatabase.h" 11 | 12 | 13 | /** Category of additions for `` class. 14 | 15 | ### See also 16 | 17 | - `` 18 | */ 19 | 20 | @interface FMDatabase (FMDatabaseAdditions) 21 | 22 | ///---------------------------------------- 23 | /// @name Return results of SQL to variable 24 | ///---------------------------------------- 25 | 26 | /** Return `int` value for query 27 | 28 | @param query The SQL query to be performed. 29 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 30 | 31 | @return `int` value. 32 | 33 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 34 | */ 35 | 36 | - (int)intForQuery:(NSString*)query, ...; 37 | 38 | /** Return `long` value for query 39 | 40 | @param query The SQL query to be performed. 41 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 42 | 43 | @return `long` value. 44 | 45 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 46 | */ 47 | 48 | - (long)longForQuery:(NSString*)query, ...; 49 | 50 | /** Return `BOOL` value for query 51 | 52 | @param query The SQL query to be performed. 53 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 54 | 55 | @return `BOOL` value. 56 | 57 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 58 | */ 59 | 60 | - (BOOL)boolForQuery:(NSString*)query, ...; 61 | 62 | /** Return `double` value for query 63 | 64 | @param query The SQL query to be performed. 65 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 66 | 67 | @return `double` value. 68 | 69 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 70 | */ 71 | 72 | - (double)doubleForQuery:(NSString*)query, ...; 73 | 74 | /** Return `NSString` value for query 75 | 76 | @param query The SQL query to be performed. 77 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 78 | 79 | @return `NSString` value. 80 | 81 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 82 | */ 83 | 84 | - (NSString*)stringForQuery:(NSString*)query, ...; 85 | 86 | /** Return `NSData` value for query 87 | 88 | @param query The SQL query to be performed. 89 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 90 | 91 | @return `NSData` value. 92 | 93 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 94 | */ 95 | 96 | - (NSData*)dataForQuery:(NSString*)query, ...; 97 | 98 | /** Return `NSDate` value for query 99 | 100 | @param query The SQL query to be performed. 101 | @param ... A list of parameters that will be bound to the `?` placeholders in the SQL query. 102 | 103 | @return `NSDate` value. 104 | 105 | @note To use this method from Swift, you must include `FMDatabaseAdditionsVariadic.swift` in your project. 106 | */ 107 | 108 | - (NSDate*)dateForQuery:(NSString*)query, ...; 109 | 110 | 111 | // Notice that there's no dataNoCopyForQuery:. 112 | // That would be a bad idea, because we close out the result set, and then what 113 | // happens to the data that we just didn't copy? Who knows, not I. 114 | 115 | 116 | ///-------------------------------- 117 | /// @name Schema related operations 118 | ///-------------------------------- 119 | 120 | /** Does table exist in database? 121 | 122 | @param tableName The name of the table being looked for. 123 | 124 | @return `YES` if table found; `NO` if not found. 125 | */ 126 | 127 | - (BOOL)tableExists:(NSString*)tableName; 128 | 129 | /** The schema of the database. 130 | 131 | This will be the schema for the entire database. For each entity, each row of the result set will include the following fields: 132 | 133 | - `type` - The type of entity (e.g. table, index, view, or trigger) 134 | - `name` - The name of the object 135 | - `tbl_name` - The name of the table to which the object references 136 | - `rootpage` - The page number of the root b-tree page for tables and indices 137 | - `sql` - The SQL that created the entity 138 | 139 | @return `FMResultSet` of schema; `nil` on error. 140 | 141 | @see [SQLite File Format](http://www.sqlite.org/fileformat.html) 142 | */ 143 | 144 | - (FMResultSet*)getSchema; 145 | 146 | /** The schema of the database. 147 | 148 | This will be the schema for a particular table as report by SQLite `PRAGMA`, for example: 149 | 150 | PRAGMA table_info('employees') 151 | 152 | This will report: 153 | 154 | - `cid` - The column ID number 155 | - `name` - The name of the column 156 | - `type` - The data type specified for the column 157 | - `notnull` - whether the field is defined as NOT NULL (i.e. values required) 158 | - `dflt_value` - The default value for the column 159 | - `pk` - Whether the field is part of the primary key of the table 160 | 161 | @param tableName The name of the table for whom the schema will be returned. 162 | 163 | @return `FMResultSet` of schema; `nil` on error. 164 | 165 | @see [table_info](http://www.sqlite.org/pragma.html#pragma_table_info) 166 | */ 167 | 168 | - (FMResultSet*)getTableSchema:(NSString*)tableName; 169 | 170 | /** Test to see if particular column exists for particular table in database 171 | 172 | @param columnName The name of the column. 173 | 174 | @param tableName The name of the table. 175 | 176 | @return `YES` if column exists in table in question; `NO` otherwise. 177 | */ 178 | 179 | - (BOOL)columnExists:(NSString*)columnName inTableWithName:(NSString*)tableName; 180 | 181 | /** Test to see if particular column exists for particular table in database 182 | 183 | @param columnName The name of the column. 184 | 185 | @param tableName The name of the table. 186 | 187 | @return `YES` if column exists in table in question; `NO` otherwise. 188 | 189 | @see columnExists:inTableWithName: 190 | 191 | @warning Deprecated - use `` instead. 192 | */ 193 | 194 | - (BOOL)columnExists:(NSString*)tableName columnName:(NSString*)columnName __attribute__ ((deprecated)); 195 | 196 | 197 | /** Validate SQL statement 198 | 199 | This validates SQL statement by performing `sqlite3_prepare_v2`, but not returning the results, but instead immediately calling `sqlite3_finalize`. 200 | 201 | @param sql The SQL statement being validated. 202 | 203 | @param error This is a pointer to a `NSError` object that will receive the autoreleased `NSError` object if there was any error. If this is `nil`, no `NSError` result will be returned. 204 | 205 | @return `YES` if validation succeeded without incident; `NO` otherwise. 206 | 207 | */ 208 | 209 | - (BOOL)validateSQL:(NSString*)sql error:(NSError**)error; 210 | 211 | 212 | ///----------------------------------- 213 | /// @name Application identifier tasks 214 | ///----------------------------------- 215 | 216 | /** Retrieve application ID 217 | 218 | @return The `uint32_t` numeric value of the application ID. 219 | 220 | @see setApplicationID: 221 | */ 222 | 223 | - (uint32_t)applicationID; 224 | 225 | /** Set the application ID 226 | 227 | @param appID The `uint32_t` numeric value of the application ID. 228 | 229 | @see applicationID 230 | */ 231 | 232 | - (void)setApplicationID:(uint32_t)appID; 233 | 234 | #if TARGET_OS_MAC && !TARGET_OS_IPHONE 235 | /** Retrieve application ID string 236 | 237 | @return The `NSString` value of the application ID. 238 | 239 | @see setApplicationIDString: 240 | */ 241 | 242 | 243 | - (NSString*)applicationIDString; 244 | 245 | /** Set the application ID string 246 | 247 | @param string The `NSString` value of the application ID. 248 | 249 | @see applicationIDString 250 | */ 251 | 252 | - (void)setApplicationIDString:(NSString*)string; 253 | 254 | #endif 255 | 256 | ///----------------------------------- 257 | /// @name user version identifier tasks 258 | ///----------------------------------- 259 | 260 | /** Retrieve user version 261 | 262 | @return The `uint32_t` numeric value of the user version. 263 | 264 | @see setUserVersion: 265 | */ 266 | 267 | - (uint32_t)userVersion; 268 | 269 | /** Set the user-version 270 | 271 | @param version The `uint32_t` numeric value of the user version. 272 | 273 | @see userVersion 274 | */ 275 | 276 | - (void)setUserVersion:(uint32_t)version; 277 | 278 | @end 279 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDatabaseAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabaseAdditions.m 3 | // fmdb 4 | // 5 | // Created by August Mueller on 10/30/05. 6 | // Copyright 2005 Flying Meat Inc.. All rights reserved. 7 | // 8 | 9 | #import "FMDatabase.h" 10 | #import "FMDatabaseAdditions.h" 11 | #import "TargetConditionals.h" 12 | 13 | #if FMDB_SQLITE_STANDALONE 14 | #import 15 | #else 16 | #import 17 | #endif 18 | 19 | @interface FMDatabase (PrivateStuff) 20 | - (FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args; 21 | @end 22 | 23 | @implementation FMDatabase (FMDatabaseAdditions) 24 | 25 | #define RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(type, sel) \ 26 | va_list args; \ 27 | va_start(args, query); \ 28 | FMResultSet *resultSet = [self executeQuery:query withArgumentsInArray:0x00 orDictionary:0x00 orVAList:args]; \ 29 | va_end(args); \ 30 | if (![resultSet next]) { return (type)0; } \ 31 | type ret = [resultSet sel:0]; \ 32 | [resultSet close]; \ 33 | [resultSet setParentDB:nil]; \ 34 | return ret; 35 | 36 | 37 | - (NSString*)stringForQuery:(NSString*)query, ... { 38 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(NSString *, stringForColumnIndex); 39 | } 40 | 41 | - (int)intForQuery:(NSString*)query, ... { 42 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(int, intForColumnIndex); 43 | } 44 | 45 | - (long)longForQuery:(NSString*)query, ... { 46 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(long, longForColumnIndex); 47 | } 48 | 49 | - (BOOL)boolForQuery:(NSString*)query, ... { 50 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(BOOL, boolForColumnIndex); 51 | } 52 | 53 | - (double)doubleForQuery:(NSString*)query, ... { 54 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(double, doubleForColumnIndex); 55 | } 56 | 57 | - (NSData*)dataForQuery:(NSString*)query, ... { 58 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(NSData *, dataForColumnIndex); 59 | } 60 | 61 | - (NSDate*)dateForQuery:(NSString*)query, ... { 62 | RETURN_RESULT_FOR_QUERY_WITH_SELECTOR(NSDate *, dateForColumnIndex); 63 | } 64 | 65 | 66 | - (BOOL)tableExists:(NSString*)tableName { 67 | 68 | tableName = [tableName lowercaseString]; 69 | 70 | FMResultSet *rs = [self executeQuery:@"select [sql] from sqlite_master where [type] = 'table' and lower(name) = ?", tableName]; 71 | 72 | //if at least one next exists, table exists 73 | BOOL returnBool = [rs next]; 74 | 75 | //close and free object 76 | [rs close]; 77 | 78 | return returnBool; 79 | } 80 | 81 | /* 82 | get table with list of tables: result colums: type[STRING], name[STRING],tbl_name[STRING],rootpage[INTEGER],sql[STRING] 83 | check if table exist in database (patch from OZLB) 84 | */ 85 | - (FMResultSet*)getSchema { 86 | 87 | //result colums: type[STRING], name[STRING],tbl_name[STRING],rootpage[INTEGER],sql[STRING] 88 | FMResultSet *rs = [self executeQuery:@"SELECT type, name, tbl_name, rootpage, sql FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type != 'meta' AND name NOT LIKE 'sqlite_%' ORDER BY tbl_name, type DESC, name"]; 89 | 90 | return rs; 91 | } 92 | 93 | /* 94 | get table schema: result colums: cid[INTEGER], name,type [STRING], notnull[INTEGER], dflt_value[],pk[INTEGER] 95 | */ 96 | - (FMResultSet*)getTableSchema:(NSString*)tableName { 97 | 98 | //result colums: cid[INTEGER], name,type [STRING], notnull[INTEGER], dflt_value[],pk[INTEGER] 99 | FMResultSet *rs = [self executeQuery:[NSString stringWithFormat: @"pragma table_info('%@')", tableName]]; 100 | 101 | return rs; 102 | } 103 | 104 | - (BOOL)columnExists:(NSString*)columnName inTableWithName:(NSString*)tableName { 105 | 106 | BOOL returnBool = NO; 107 | 108 | tableName = [tableName lowercaseString]; 109 | columnName = [columnName lowercaseString]; 110 | 111 | FMResultSet *rs = [self getTableSchema:tableName]; 112 | 113 | //check if column is present in table schema 114 | while ([rs next]) { 115 | if ([[[rs stringForColumn:@"name"] lowercaseString] isEqualToString:columnName]) { 116 | returnBool = YES; 117 | break; 118 | } 119 | } 120 | 121 | //If this is not done FMDatabase instance stays out of pool 122 | [rs close]; 123 | 124 | return returnBool; 125 | } 126 | 127 | 128 | 129 | - (uint32_t)applicationID { 130 | #if SQLITE_VERSION_NUMBER >= 3007017 131 | uint32_t r = 0; 132 | 133 | FMResultSet *rs = [self executeQuery:@"pragma application_id"]; 134 | 135 | if ([rs next]) { 136 | r = (uint32_t)[rs longLongIntForColumnIndex:0]; 137 | } 138 | 139 | [rs close]; 140 | 141 | return r; 142 | #else 143 | NSString *errorMessage = NSLocalizedString(@"Application ID functions require SQLite 3.7.17", nil); 144 | if (self.logsErrors) NSLog(@"%@", errorMessage); 145 | return 0; 146 | #endif 147 | } 148 | 149 | - (void)setApplicationID:(uint32_t)appID { 150 | #if SQLITE_VERSION_NUMBER >= 3007017 151 | NSString *query = [NSString stringWithFormat:@"pragma application_id=%d", appID]; 152 | FMResultSet *rs = [self executeQuery:query]; 153 | [rs next]; 154 | [rs close]; 155 | #else 156 | NSString *errorMessage = NSLocalizedString(@"Application ID functions require SQLite 3.7.17", nil); 157 | if (self.logsErrors) NSLog(@"%@", errorMessage); 158 | #endif 159 | } 160 | 161 | 162 | #if TARGET_OS_MAC && !TARGET_OS_IPHONE 163 | 164 | - (NSString*)applicationIDString { 165 | #if SQLITE_VERSION_NUMBER >= 3007017 166 | NSString *s = NSFileTypeForHFSTypeCode([self applicationID]); 167 | 168 | assert([s length] == 6); 169 | 170 | s = [s substringWithRange:NSMakeRange(1, 4)]; 171 | 172 | 173 | return s; 174 | #else 175 | NSString *errorMessage = NSLocalizedString(@"Application ID functions require SQLite 3.7.17", nil); 176 | if (self.logsErrors) NSLog(@"%@", errorMessage); 177 | return nil; 178 | #endif 179 | } 180 | 181 | - (void)setApplicationIDString:(NSString*)s { 182 | #if SQLITE_VERSION_NUMBER >= 3007017 183 | if ([s length] != 4) { 184 | NSLog(@"setApplicationIDString: string passed is not exactly 4 chars long. (was %ld)", [s length]); 185 | } 186 | 187 | [self setApplicationID:NSHFSTypeCodeFromFileType([NSString stringWithFormat:@"'%@'", s])]; 188 | #else 189 | NSString *errorMessage = NSLocalizedString(@"Application ID functions require SQLite 3.7.17", nil); 190 | if (self.logsErrors) NSLog(@"%@", errorMessage); 191 | #endif 192 | } 193 | 194 | #endif 195 | 196 | - (uint32_t)userVersion { 197 | uint32_t r = 0; 198 | 199 | FMResultSet *rs = [self executeQuery:@"pragma user_version"]; 200 | 201 | if ([rs next]) { 202 | r = (uint32_t)[rs longLongIntForColumnIndex:0]; 203 | } 204 | 205 | [rs close]; 206 | return r; 207 | } 208 | 209 | - (void)setUserVersion:(uint32_t)version { 210 | NSString *query = [NSString stringWithFormat:@"pragma user_version = %d", version]; 211 | FMResultSet *rs = [self executeQuery:query]; 212 | [rs next]; 213 | [rs close]; 214 | } 215 | 216 | #pragma clang diagnostic push 217 | #pragma clang diagnostic ignored "-Wdeprecated-implementations" 218 | 219 | - (BOOL)columnExists:(NSString*)tableName columnName:(NSString*)columnName __attribute__ ((deprecated)) { 220 | return [self columnExists:columnName inTableWithName:tableName]; 221 | } 222 | 223 | #pragma clang diagnostic pop 224 | 225 | 226 | - (BOOL)validateSQL:(NSString*)sql error:(NSError**)error { 227 | sqlite3_stmt *pStmt = NULL; 228 | BOOL validationSucceeded = YES; 229 | 230 | int rc = sqlite3_prepare_v2(_db, [sql UTF8String], -1, &pStmt, 0); 231 | if (rc != SQLITE_OK) { 232 | validationSucceeded = NO; 233 | if (error) { 234 | *error = [NSError errorWithDomain:NSCocoaErrorDomain 235 | code:[self lastErrorCode] 236 | userInfo:[NSDictionary dictionaryWithObject:[self lastErrorMessage] 237 | forKey:NSLocalizedDescriptionKey]]; 238 | } 239 | } 240 | 241 | sqlite3_finalize(pStmt); 242 | 243 | return validationSucceeded; 244 | } 245 | 246 | @end 247 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDatabasePool.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabasePool.h 3 | // fmdb 4 | // 5 | // Created by August Mueller on 6/22/11. 6 | // Copyright 2011 Flying Meat Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMDatabase; 12 | 13 | /** Pool of `` objects. 14 | 15 | ### See also 16 | 17 | - `` 18 | - `` 19 | 20 | @warning Before using `FMDatabasePool`, please consider using `` instead. 21 | 22 | If you really really really know what you're doing and `FMDatabasePool` is what 23 | you really really need (ie, you're using a read only database), OK you can use 24 | it. But just be careful not to deadlock! 25 | 26 | For an example on deadlocking, search for: 27 | `ONLY_USE_THE_POOL_IF_YOU_ARE_DOING_READS_OTHERWISE_YOULL_DEADLOCK_USE_FMDATABASEQUEUE_INSTEAD` 28 | in the main.m file. 29 | */ 30 | 31 | @interface FMDatabasePool : NSObject { 32 | NSString *_path; 33 | 34 | dispatch_queue_t _lockQueue; 35 | 36 | NSMutableArray *_databaseInPool; 37 | NSMutableArray *_databaseOutPool; 38 | 39 | __unsafe_unretained id _delegate; 40 | 41 | NSUInteger _maximumNumberOfDatabasesToCreate; 42 | int _openFlags; 43 | } 44 | 45 | /** Database path */ 46 | 47 | @property (atomic, retain) NSString *path; 48 | 49 | /** Delegate object */ 50 | 51 | @property (atomic, assign) id delegate; 52 | 53 | /** Maximum number of databases to create */ 54 | 55 | @property (atomic, assign) NSUInteger maximumNumberOfDatabasesToCreate; 56 | 57 | /** Open flags */ 58 | 59 | @property (atomic, readonly) int openFlags; 60 | 61 | 62 | ///--------------------- 63 | /// @name Initialization 64 | ///--------------------- 65 | 66 | /** Create pool using path. 67 | 68 | @param aPath The file path of the database. 69 | 70 | @return The `FMDatabasePool` object. `nil` on error. 71 | */ 72 | 73 | + (instancetype)databasePoolWithPath:(NSString*)aPath; 74 | 75 | /** Create pool using path and specified flags 76 | 77 | @param aPath The file path of the database. 78 | @param openFlags Flags passed to the openWithFlags method of the database 79 | 80 | @return The `FMDatabasePool` object. `nil` on error. 81 | */ 82 | 83 | + (instancetype)databasePoolWithPath:(NSString*)aPath flags:(int)openFlags; 84 | 85 | /** Create pool using path. 86 | 87 | @param aPath The file path of the database. 88 | 89 | @return The `FMDatabasePool` object. `nil` on error. 90 | */ 91 | 92 | - (instancetype)initWithPath:(NSString*)aPath; 93 | 94 | /** Create pool using path and specified flags. 95 | 96 | @param aPath The file path of the database. 97 | @param openFlags Flags passed to the openWithFlags method of the database 98 | 99 | @return The `FMDatabasePool` object. `nil` on error. 100 | */ 101 | 102 | - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags; 103 | 104 | ///------------------------------------------------ 105 | /// @name Keeping track of checked in/out databases 106 | ///------------------------------------------------ 107 | 108 | /** Number of checked-in databases in pool 109 | 110 | @returns Number of databases 111 | */ 112 | 113 | - (NSUInteger)countOfCheckedInDatabases; 114 | 115 | /** Number of checked-out databases in pool 116 | 117 | @returns Number of databases 118 | */ 119 | 120 | - (NSUInteger)countOfCheckedOutDatabases; 121 | 122 | /** Total number of databases in pool 123 | 124 | @returns Number of databases 125 | */ 126 | 127 | - (NSUInteger)countOfOpenDatabases; 128 | 129 | /** Release all databases in pool */ 130 | 131 | - (void)releaseAllDatabases; 132 | 133 | ///------------------------------------------ 134 | /// @name Perform database operations in pool 135 | ///------------------------------------------ 136 | 137 | /** Synchronously perform database operations in pool. 138 | 139 | @param block The code to be run on the `FMDatabasePool` pool. 140 | */ 141 | 142 | - (void)inDatabase:(void (^)(FMDatabase *db))block; 143 | 144 | /** Synchronously perform database operations in pool using transaction. 145 | 146 | @param block The code to be run on the `FMDatabasePool` pool. 147 | */ 148 | 149 | - (void)inTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block; 150 | 151 | /** Synchronously perform database operations in pool using deferred transaction. 152 | 153 | @param block The code to be run on the `FMDatabasePool` pool. 154 | */ 155 | 156 | - (void)inDeferredTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block; 157 | 158 | /** Synchronously perform database operations in pool using save point. 159 | 160 | @param block The code to be run on the `FMDatabasePool` pool. 161 | 162 | @return `NSError` object if error; `nil` if successful. 163 | 164 | @warning You can not nest these, since calling it will pull another database out of the pool and you'll get a deadlock. If you need to nest, use `<[FMDatabase startSavePointWithName:error:]>` instead. 165 | */ 166 | 167 | - (NSError*)inSavePoint:(void (^)(FMDatabase *db, BOOL *rollback))block; 168 | 169 | @end 170 | 171 | 172 | /** FMDatabasePool delegate category 173 | 174 | This is a category that defines the protocol for the FMDatabasePool delegate 175 | */ 176 | 177 | @interface NSObject (FMDatabasePoolDelegate) 178 | 179 | /** Asks the delegate whether database should be added to the pool. 180 | 181 | @param pool The `FMDatabasePool` object. 182 | @param database The `FMDatabase` object. 183 | 184 | @return `YES` if it should add database to pool; `NO` if not. 185 | 186 | */ 187 | 188 | - (BOOL)databasePool:(FMDatabasePool*)pool shouldAddDatabaseToPool:(FMDatabase*)database; 189 | 190 | /** Tells the delegate that database was added to the pool. 191 | 192 | @param pool The `FMDatabasePool` object. 193 | @param database The `FMDatabase` object. 194 | 195 | */ 196 | 197 | - (void)databasePool:(FMDatabasePool*)pool didAddDatabase:(FMDatabase*)database; 198 | 199 | @end 200 | 201 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDatabasePool.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabasePool.m 3 | // fmdb 4 | // 5 | // Created by August Mueller on 6/22/11. 6 | // Copyright 2011 Flying Meat Inc. All rights reserved. 7 | // 8 | 9 | #if FMDB_SQLITE_STANDALONE 10 | #import 11 | #else 12 | #import 13 | #endif 14 | 15 | #import "FMDatabasePool.h" 16 | #import "FMDatabase.h" 17 | 18 | @interface FMDatabasePool() 19 | 20 | - (void)pushDatabaseBackInPool:(FMDatabase*)db; 21 | - (FMDatabase*)db; 22 | 23 | @end 24 | 25 | 26 | @implementation FMDatabasePool 27 | @synthesize path=_path; 28 | @synthesize delegate=_delegate; 29 | @synthesize maximumNumberOfDatabasesToCreate=_maximumNumberOfDatabasesToCreate; 30 | @synthesize openFlags=_openFlags; 31 | 32 | 33 | + (instancetype)databasePoolWithPath:(NSString*)aPath { 34 | return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath]); 35 | } 36 | 37 | + (instancetype)databasePoolWithPath:(NSString*)aPath flags:(int)openFlags { 38 | return FMDBReturnAutoreleased([[self alloc] initWithPath:aPath flags:openFlags]); 39 | } 40 | 41 | - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags { 42 | 43 | self = [super init]; 44 | 45 | if (self != nil) { 46 | _path = [aPath copy]; 47 | _lockQueue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL); 48 | _databaseInPool = FMDBReturnRetained([NSMutableArray array]); 49 | _databaseOutPool = FMDBReturnRetained([NSMutableArray array]); 50 | _openFlags = openFlags; 51 | } 52 | 53 | return self; 54 | } 55 | 56 | - (instancetype)initWithPath:(NSString*)aPath 57 | { 58 | // default flags for sqlite3_open 59 | return [self initWithPath:aPath flags:SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE]; 60 | } 61 | 62 | - (instancetype)init { 63 | return [self initWithPath:nil]; 64 | } 65 | 66 | 67 | - (void)dealloc { 68 | 69 | _delegate = 0x00; 70 | FMDBRelease(_path); 71 | FMDBRelease(_databaseInPool); 72 | FMDBRelease(_databaseOutPool); 73 | 74 | if (_lockQueue) { 75 | FMDBDispatchQueueRelease(_lockQueue); 76 | _lockQueue = 0x00; 77 | } 78 | #if ! __has_feature(objc_arc) 79 | [super dealloc]; 80 | #endif 81 | } 82 | 83 | 84 | - (void)executeLocked:(void (^)(void))aBlock { 85 | dispatch_sync(_lockQueue, aBlock); 86 | } 87 | 88 | - (void)pushDatabaseBackInPool:(FMDatabase*)db { 89 | 90 | if (!db) { // db can be null if we set an upper bound on the # of databases to create. 91 | return; 92 | } 93 | 94 | [self executeLocked:^() { 95 | 96 | if ([self->_databaseInPool containsObject:db]) { 97 | [[NSException exceptionWithName:@"Database already in pool" reason:@"The FMDatabase being put back into the pool is already present in the pool" userInfo:nil] raise]; 98 | } 99 | 100 | [self->_databaseInPool addObject:db]; 101 | [self->_databaseOutPool removeObject:db]; 102 | 103 | }]; 104 | } 105 | 106 | - (FMDatabase*)db { 107 | 108 | __block FMDatabase *db; 109 | 110 | 111 | [self executeLocked:^() { 112 | db = [self->_databaseInPool lastObject]; 113 | 114 | BOOL shouldNotifyDelegate = NO; 115 | 116 | if (db) { 117 | [self->_databaseOutPool addObject:db]; 118 | [self->_databaseInPool removeLastObject]; 119 | } 120 | else { 121 | 122 | if (self->_maximumNumberOfDatabasesToCreate) { 123 | NSUInteger currentCount = [self->_databaseOutPool count] + [self->_databaseInPool count]; 124 | 125 | if (currentCount >= self->_maximumNumberOfDatabasesToCreate) { 126 | NSLog(@"Maximum number of databases (%ld) has already been reached!", (long)currentCount); 127 | return; 128 | } 129 | } 130 | 131 | db = [FMDatabase databaseWithPath:self->_path]; 132 | shouldNotifyDelegate = YES; 133 | } 134 | 135 | //This ensures that the db is opened before returning 136 | #if SQLITE_VERSION_NUMBER >= 3005000 137 | BOOL success = [db openWithFlags:self->_openFlags]; 138 | #else 139 | BOOL success = [db open]; 140 | #endif 141 | if (success) { 142 | if ([self->_delegate respondsToSelector:@selector(databasePool:shouldAddDatabaseToPool:)] && ![self->_delegate databasePool:self shouldAddDatabaseToPool:db]) { 143 | [db close]; 144 | db = 0x00; 145 | } 146 | else { 147 | //It should not get added in the pool twice if lastObject was found 148 | if (![self->_databaseOutPool containsObject:db]) { 149 | [self->_databaseOutPool addObject:db]; 150 | 151 | if (shouldNotifyDelegate && [self->_delegate respondsToSelector:@selector(databasePool:didAddDatabase:)]) { 152 | [self->_delegate databasePool:self didAddDatabase:db]; 153 | } 154 | } 155 | } 156 | } 157 | else { 158 | NSLog(@"Could not open up the database at path %@", self->_path); 159 | db = 0x00; 160 | } 161 | }]; 162 | 163 | return db; 164 | } 165 | 166 | - (NSUInteger)countOfCheckedInDatabases { 167 | 168 | __block NSUInteger count; 169 | 170 | [self executeLocked:^() { 171 | count = [self->_databaseInPool count]; 172 | }]; 173 | 174 | return count; 175 | } 176 | 177 | - (NSUInteger)countOfCheckedOutDatabases { 178 | 179 | __block NSUInteger count; 180 | 181 | [self executeLocked:^() { 182 | count = [self->_databaseOutPool count]; 183 | }]; 184 | 185 | return count; 186 | } 187 | 188 | - (NSUInteger)countOfOpenDatabases { 189 | __block NSUInteger count; 190 | 191 | [self executeLocked:^() { 192 | count = [self->_databaseOutPool count] + [self->_databaseInPool count]; 193 | }]; 194 | 195 | return count; 196 | } 197 | 198 | - (void)releaseAllDatabases { 199 | [self executeLocked:^() { 200 | [self->_databaseOutPool removeAllObjects]; 201 | [self->_databaseInPool removeAllObjects]; 202 | }]; 203 | } 204 | 205 | - (void)inDatabase:(void (^)(FMDatabase *db))block { 206 | 207 | FMDatabase *db = [self db]; 208 | 209 | block(db); 210 | 211 | [self pushDatabaseBackInPool:db]; 212 | } 213 | 214 | - (void)beginTransaction:(BOOL)useDeferred withBlock:(void (^)(FMDatabase *db, BOOL *rollback))block { 215 | 216 | BOOL shouldRollback = NO; 217 | 218 | FMDatabase *db = [self db]; 219 | 220 | if (useDeferred) { 221 | [db beginDeferredTransaction]; 222 | } 223 | else { 224 | [db beginTransaction]; 225 | } 226 | 227 | 228 | block(db, &shouldRollback); 229 | 230 | if (shouldRollback) { 231 | [db rollback]; 232 | } 233 | else { 234 | [db commit]; 235 | } 236 | 237 | [self pushDatabaseBackInPool:db]; 238 | } 239 | 240 | - (void)inDeferredTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block { 241 | [self beginTransaction:YES withBlock:block]; 242 | } 243 | 244 | - (void)inTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block { 245 | [self beginTransaction:NO withBlock:block]; 246 | } 247 | 248 | - (NSError*)inSavePoint:(void (^)(FMDatabase *db, BOOL *rollback))block { 249 | #if SQLITE_VERSION_NUMBER >= 3007000 250 | static unsigned long savePointIdx = 0; 251 | 252 | NSString *name = [NSString stringWithFormat:@"savePoint%ld", savePointIdx++]; 253 | 254 | BOOL shouldRollback = NO; 255 | 256 | FMDatabase *db = [self db]; 257 | 258 | NSError *err = 0x00; 259 | 260 | if (![db startSavePointWithName:name error:&err]) { 261 | [self pushDatabaseBackInPool:db]; 262 | return err; 263 | } 264 | 265 | block(db, &shouldRollback); 266 | 267 | if (shouldRollback) { 268 | // We need to rollback and release this savepoint to remove it 269 | [db rollbackToSavePointWithName:name error:&err]; 270 | } 271 | [db releaseSavePointWithName:name error:&err]; 272 | 273 | [self pushDatabaseBackInPool:db]; 274 | 275 | return err; 276 | #else 277 | NSString *errorMessage = NSLocalizedString(@"Save point functions require SQLite 3.7", nil); 278 | if (self.logsErrors) NSLog(@"%@", errorMessage); 279 | return [NSError errorWithDomain:@"FMDatabase" code:0 userInfo:@{NSLocalizedDescriptionKey : errorMessage}]; 280 | #endif 281 | } 282 | 283 | @end 284 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDatabaseQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabaseQueue.h 3 | // fmdb 4 | // 5 | // Created by August Mueller on 6/22/11. 6 | // Copyright 2011 Flying Meat Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class FMDatabase; 12 | 13 | /** To perform queries and updates on multiple threads, you'll want to use `FMDatabaseQueue`. 14 | 15 | Using a single instance of `` from multiple threads at once is a bad idea. It has always been OK to make a `` object *per thread*. Just don't share a single instance across threads, and definitely not across multiple threads at the same time. 16 | 17 | Instead, use `FMDatabaseQueue`. Here's how to use it: 18 | 19 | First, make your queue. 20 | 21 | FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath]; 22 | 23 | Then use it like so: 24 | 25 | [queue inDatabase:^(FMDatabase *db) { 26 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]]; 27 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]]; 28 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]]; 29 | 30 | FMResultSet *rs = [db executeQuery:@"select * from foo"]; 31 | while ([rs next]) { 32 | //… 33 | } 34 | }]; 35 | 36 | An easy way to wrap things up in a transaction can be done like this: 37 | 38 | [queue inTransaction:^(FMDatabase *db, BOOL *rollback) { 39 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]]; 40 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]]; 41 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]]; 42 | 43 | if (whoopsSomethingWrongHappened) { 44 | *rollback = YES; 45 | return; 46 | } 47 | // etc… 48 | [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:4]]; 49 | }]; 50 | 51 | `FMDatabaseQueue` will run the blocks on a serialized queue (hence the name of the class). So if you call `FMDatabaseQueue`'s methods from multiple threads at the same time, they will be executed in the order they are received. This way queries and updates won't step on each other's toes, and every one is happy. 52 | 53 | ### See also 54 | 55 | - `` 56 | 57 | @warning Do not instantiate a single `` object and use it across multiple threads. Use `FMDatabaseQueue` instead. 58 | 59 | @warning The calls to `FMDatabaseQueue`'s methods are blocking. So even though you are passing along blocks, they will **not** be run on another thread. 60 | 61 | */ 62 | 63 | @interface FMDatabaseQueue : NSObject { 64 | NSString *_path; 65 | dispatch_queue_t _queue; 66 | FMDatabase *_db; 67 | int _openFlags; 68 | } 69 | 70 | /** Path of database */ 71 | 72 | @property (atomic, retain) NSString *path; 73 | 74 | /** Open flags */ 75 | 76 | @property (atomic, readonly) int openFlags; 77 | 78 | ///---------------------------------------------------- 79 | /// @name Initialization, opening, and closing of queue 80 | ///---------------------------------------------------- 81 | 82 | /** Create queue using path. 83 | 84 | @param aPath The file path of the database. 85 | 86 | @return The `FMDatabaseQueue` object. `nil` on error. 87 | */ 88 | 89 | + (instancetype)databaseQueueWithPath:(NSString*)aPath; 90 | 91 | /** Create queue using path and specified flags. 92 | 93 | @param aPath The file path of the database. 94 | @param openFlags Flags passed to the openWithFlags method of the database 95 | 96 | @return The `FMDatabaseQueue` object. `nil` on error. 97 | */ 98 | + (instancetype)databaseQueueWithPath:(NSString*)aPath flags:(int)openFlags; 99 | 100 | /** Create queue using path. 101 | 102 | @param aPath The file path of the database. 103 | 104 | @return The `FMDatabaseQueue` object. `nil` on error. 105 | */ 106 | 107 | - (instancetype)initWithPath:(NSString*)aPath; 108 | 109 | /** Create queue using path and specified flags. 110 | 111 | @param aPath The file path of the database. 112 | @param openFlags Flags passed to the openWithFlags method of the database 113 | 114 | @return The `FMDatabaseQueue` object. `nil` on error. 115 | */ 116 | 117 | - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags; 118 | 119 | /** Create queue using path and specified flags. 120 | 121 | @param aPath The file path of the database. 122 | @param openFlags Flags passed to the openWithFlags method of the database 123 | @param vfsName The name of a custom virtual file system 124 | 125 | @return The `FMDatabaseQueue` object. `nil` on error. 126 | */ 127 | 128 | - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags vfs:(NSString *)vfsName; 129 | 130 | /** Returns the Class of 'FMDatabase' subclass, that will be used to instantiate database object. 131 | 132 | Subclasses can override this method to return specified Class of 'FMDatabase' subclass. 133 | 134 | @return The Class of 'FMDatabase' subclass, that will be used to instantiate database object. 135 | */ 136 | 137 | + (Class)databaseClass; 138 | 139 | /** Close database used by queue. */ 140 | 141 | - (void)close; 142 | 143 | ///----------------------------------------------- 144 | /// @name Dispatching database operations to queue 145 | ///----------------------------------------------- 146 | 147 | /** Synchronously perform database operations on queue. 148 | 149 | @param block The code to be run on the queue of `FMDatabaseQueue` 150 | */ 151 | 152 | - (void)inDatabase:(void (^)(FMDatabase *db))block; 153 | 154 | /** Synchronously perform database operations on queue, using transactions. 155 | 156 | @param block The code to be run on the queue of `FMDatabaseQueue` 157 | */ 158 | 159 | - (void)inTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block; 160 | 161 | /** Synchronously perform database operations on queue, using deferred transactions. 162 | 163 | @param block The code to be run on the queue of `FMDatabaseQueue` 164 | */ 165 | 166 | - (void)inDeferredTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block; 167 | 168 | ///----------------------------------------------- 169 | /// @name Dispatching database operations to queue 170 | ///----------------------------------------------- 171 | 172 | /** Synchronously perform database operations using save point. 173 | 174 | @param block The code to be run on the queue of `FMDatabaseQueue` 175 | */ 176 | 177 | // NOTE: you can not nest these, since calling it will pull another database out of the pool and you'll get a deadlock. 178 | // If you need to nest, use FMDatabase's startSavePointWithName:error: instead. 179 | - (NSError*)inSavePoint:(void (^)(FMDatabase *db, BOOL *rollback))block; 180 | 181 | @end 182 | 183 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMDatabaseQueue.m: -------------------------------------------------------------------------------- 1 | // 2 | // FMDatabaseQueue.m 3 | // fmdb 4 | // 5 | // Created by August Mueller on 6/22/11. 6 | // Copyright 2011 Flying Meat Inc. All rights reserved. 7 | // 8 | 9 | #import "FMDatabaseQueue.h" 10 | #import "FMDatabase.h" 11 | 12 | #if FMDB_SQLITE_STANDALONE 13 | #import 14 | #else 15 | #import 16 | #endif 17 | 18 | /* 19 | 20 | Note: we call [self retain]; before using dispatch_sync, just incase 21 | FMDatabaseQueue is released on another thread and we're in the middle of doing 22 | something in dispatch_sync 23 | 24 | */ 25 | 26 | /* 27 | * A key used to associate the FMDatabaseQueue object with the dispatch_queue_t it uses. 28 | * This in turn is used for deadlock detection by seeing if inDatabase: is called on 29 | * the queue's dispatch queue, which should not happen and causes a deadlock. 30 | */ 31 | static const void * const kDispatchQueueSpecificKey = &kDispatchQueueSpecificKey; 32 | 33 | @implementation FMDatabaseQueue 34 | 35 | @synthesize path = _path; 36 | @synthesize openFlags = _openFlags; 37 | 38 | + (instancetype)databaseQueueWithPath:(NSString*)aPath { 39 | 40 | FMDatabaseQueue *q = [[self alloc] initWithPath:aPath]; 41 | 42 | FMDBAutorelease(q); 43 | 44 | return q; 45 | } 46 | 47 | + (instancetype)databaseQueueWithPath:(NSString*)aPath flags:(int)openFlags { 48 | 49 | FMDatabaseQueue *q = [[self alloc] initWithPath:aPath flags:openFlags]; 50 | 51 | FMDBAutorelease(q); 52 | 53 | return q; 54 | } 55 | 56 | + (Class)databaseClass { 57 | return [FMDatabase class]; 58 | } 59 | 60 | - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags vfs:(NSString *)vfsName { 61 | 62 | self = [super init]; 63 | 64 | if (self != nil) { 65 | 66 | _db = [[[self class] databaseClass] databaseWithPath:aPath]; 67 | FMDBRetain(_db); 68 | 69 | #if SQLITE_VERSION_NUMBER >= 3005000 70 | BOOL success = [_db openWithFlags:openFlags vfs:vfsName]; 71 | #else 72 | BOOL success = [_db open]; 73 | #endif 74 | if (!success) { 75 | NSLog(@"Could not create database queue for path %@", aPath); 76 | FMDBRelease(self); 77 | return 0x00; 78 | } 79 | 80 | _path = FMDBReturnRetained(aPath); 81 | 82 | _queue = dispatch_queue_create([[NSString stringWithFormat:@"fmdb.%@", self] UTF8String], NULL); 83 | dispatch_queue_set_specific(_queue, kDispatchQueueSpecificKey, (__bridge void *)self, NULL); 84 | _openFlags = openFlags; 85 | } 86 | 87 | return self; 88 | } 89 | 90 | - (instancetype)initWithPath:(NSString*)aPath flags:(int)openFlags { 91 | return [self initWithPath:aPath flags:openFlags vfs:nil]; 92 | } 93 | 94 | - (instancetype)initWithPath:(NSString*)aPath { 95 | 96 | // default flags for sqlite3_open 97 | return [self initWithPath:aPath flags:SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE vfs:nil]; 98 | } 99 | 100 | - (instancetype)init { 101 | return [self initWithPath:nil]; 102 | } 103 | 104 | 105 | - (void)dealloc { 106 | 107 | FMDBRelease(_db); 108 | FMDBRelease(_path); 109 | 110 | if (_queue) { 111 | FMDBDispatchQueueRelease(_queue); 112 | _queue = 0x00; 113 | } 114 | #if ! __has_feature(objc_arc) 115 | [super dealloc]; 116 | #endif 117 | } 118 | 119 | - (void)close { 120 | FMDBRetain(self); 121 | dispatch_sync(_queue, ^() { 122 | [self->_db close]; 123 | FMDBRelease(_db); 124 | self->_db = 0x00; 125 | }); 126 | FMDBRelease(self); 127 | } 128 | 129 | - (FMDatabase*)database { 130 | if (!_db) { 131 | _db = FMDBReturnRetained([FMDatabase databaseWithPath:_path]); 132 | 133 | #if SQLITE_VERSION_NUMBER >= 3005000 134 | BOOL success = [_db openWithFlags:_openFlags]; 135 | #else 136 | BOOL success = [_db open]; 137 | #endif 138 | if (!success) { 139 | NSLog(@"FMDatabaseQueue could not reopen database for path %@", _path); 140 | FMDBRelease(_db); 141 | _db = 0x00; 142 | return 0x00; 143 | } 144 | } 145 | 146 | return _db; 147 | } 148 | 149 | - (void)inDatabase:(void (^)(FMDatabase *db))block { 150 | /* Get the currently executing queue (which should probably be nil, but in theory could be another DB queue 151 | * and then check it against self to make sure we're not about to deadlock. */ 152 | FMDatabaseQueue *currentSyncQueue = (__bridge id)dispatch_get_specific(kDispatchQueueSpecificKey); 153 | assert(currentSyncQueue != self && "inDatabase: was called reentrantly on the same queue, which would lead to a deadlock"); 154 | 155 | FMDBRetain(self); 156 | 157 | dispatch_sync(_queue, ^() { 158 | 159 | FMDatabase *db = [self database]; 160 | block(db); 161 | 162 | if ([db hasOpenResultSets]) { 163 | NSLog(@"Warning: there is at least one open result set around after performing [FMDatabaseQueue inDatabase:]"); 164 | 165 | #if defined(DEBUG) && DEBUG 166 | NSSet *openSetCopy = FMDBReturnAutoreleased([[db valueForKey:@"_openResultSets"] copy]); 167 | for (NSValue *rsInWrappedInATastyValueMeal in openSetCopy) { 168 | FMResultSet *rs = (FMResultSet *)[rsInWrappedInATastyValueMeal pointerValue]; 169 | NSLog(@"query: '%@'", [rs query]); 170 | } 171 | #endif 172 | } 173 | }); 174 | 175 | FMDBRelease(self); 176 | } 177 | 178 | 179 | - (void)beginTransaction:(BOOL)useDeferred withBlock:(void (^)(FMDatabase *db, BOOL *rollback))block { 180 | FMDBRetain(self); 181 | dispatch_sync(_queue, ^() { 182 | 183 | BOOL shouldRollback = NO; 184 | 185 | if (useDeferred) { 186 | [[self database] beginDeferredTransaction]; 187 | } 188 | else { 189 | [[self database] beginTransaction]; 190 | } 191 | 192 | block([self database], &shouldRollback); 193 | 194 | if (shouldRollback) { 195 | [[self database] rollback]; 196 | } 197 | else { 198 | [[self database] commit]; 199 | } 200 | }); 201 | 202 | FMDBRelease(self); 203 | } 204 | 205 | - (void)inDeferredTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block { 206 | [self beginTransaction:YES withBlock:block]; 207 | } 208 | 209 | - (void)inTransaction:(void (^)(FMDatabase *db, BOOL *rollback))block { 210 | [self beginTransaction:NO withBlock:block]; 211 | } 212 | 213 | - (NSError*)inSavePoint:(void (^)(FMDatabase *db, BOOL *rollback))block { 214 | #if SQLITE_VERSION_NUMBER >= 3007000 215 | static unsigned long savePointIdx = 0; 216 | __block NSError *err = 0x00; 217 | FMDBRetain(self); 218 | dispatch_sync(_queue, ^() { 219 | 220 | NSString *name = [NSString stringWithFormat:@"savePoint%ld", savePointIdx++]; 221 | 222 | BOOL shouldRollback = NO; 223 | 224 | if ([[self database] startSavePointWithName:name error:&err]) { 225 | 226 | block([self database], &shouldRollback); 227 | 228 | if (shouldRollback) { 229 | // We need to rollback and release this savepoint to remove it 230 | [[self database] rollbackToSavePointWithName:name error:&err]; 231 | } 232 | [[self database] releaseSavePointWithName:name error:&err]; 233 | 234 | } 235 | }); 236 | FMDBRelease(self); 237 | return err; 238 | #else 239 | NSString *errorMessage = NSLocalizedString(@"Save point functions require SQLite 3.7", nil); 240 | if (self.logsErrors) NSLog(@"%@", errorMessage); 241 | return [NSError errorWithDomain:@"FMDatabase" code:0 userInfo:@{NSLocalizedDescriptionKey : errorMessage}]; 242 | #endif 243 | } 244 | 245 | @end 246 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMResultSet.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #ifndef __has_feature // Optional. 4 | #define __has_feature(x) 0 // Compatibility with non-clang compilers. 5 | #endif 6 | 7 | #ifndef NS_RETURNS_NOT_RETAINED 8 | #if __has_feature(attribute_ns_returns_not_retained) 9 | #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained)) 10 | #else 11 | #define NS_RETURNS_NOT_RETAINED 12 | #endif 13 | #endif 14 | 15 | @class FMDatabase; 16 | @class FMStatement; 17 | 18 | /** Represents the results of executing a query on an ``. 19 | 20 | ### See also 21 | 22 | - `` 23 | */ 24 | 25 | @interface FMResultSet : NSObject { 26 | FMDatabase *_parentDB; 27 | FMStatement *_statement; 28 | 29 | NSString *_query; 30 | NSMutableDictionary *_columnNameToIndexMap; 31 | } 32 | 33 | ///----------------- 34 | /// @name Properties 35 | ///----------------- 36 | 37 | /** Executed query */ 38 | 39 | @property (atomic, retain) NSString *query; 40 | 41 | /** `NSMutableDictionary` mapping column names to numeric index */ 42 | 43 | @property (readonly) NSMutableDictionary *columnNameToIndexMap; 44 | 45 | /** `FMStatement` used by result set. */ 46 | 47 | @property (atomic, retain) FMStatement *statement; 48 | 49 | ///------------------------------------ 50 | /// @name Creating and closing database 51 | ///------------------------------------ 52 | 53 | /** Create result set from `` 54 | 55 | @param statement A `` to be performed 56 | 57 | @param aDB A `` to be used 58 | 59 | @return A `FMResultSet` on success; `nil` on failure 60 | */ 61 | 62 | + (instancetype)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB; 63 | 64 | /** Close result set */ 65 | 66 | - (void)close; 67 | 68 | - (void)setParentDB:(FMDatabase *)newDb; 69 | 70 | ///--------------------------------------- 71 | /// @name Iterating through the result set 72 | ///--------------------------------------- 73 | 74 | /** Retrieve next row for result set. 75 | 76 | You must always invoke `next` or `nextWithError` before attempting to access the values returned in a query, even if you're only expecting one. 77 | 78 | @return `YES` if row successfully retrieved; `NO` if end of result set reached 79 | 80 | @see hasAnotherRow 81 | */ 82 | 83 | - (BOOL)next; 84 | 85 | /** Retrieve next row for result set. 86 | 87 | You must always invoke `next` or `nextWithError` before attempting to access the values returned in a query, even if you're only expecting one. 88 | 89 | @param outErr A 'NSError' object to receive any error object (if any). 90 | 91 | @return 'YES' if row successfully retrieved; 'NO' if end of result set reached 92 | 93 | @see hasAnotherRow 94 | */ 95 | 96 | - (BOOL)nextWithError:(NSError **)outErr; 97 | 98 | /** Did the last call to `` succeed in retrieving another row? 99 | 100 | @return `YES` if the last call to `` succeeded in retrieving another record; `NO` if not. 101 | 102 | @see next 103 | 104 | @warning The `hasAnotherRow` method must follow a call to ``. If the previous database interaction was something other than a call to `next`, then this method may return `NO`, whether there is another row of data or not. 105 | */ 106 | 107 | - (BOOL)hasAnotherRow; 108 | 109 | ///--------------------------------------------- 110 | /// @name Retrieving information from result set 111 | ///--------------------------------------------- 112 | 113 | /** How many columns in result set 114 | 115 | @return Integer value of the number of columns. 116 | */ 117 | 118 | - (int)columnCount; 119 | 120 | /** Column index for column name 121 | 122 | @param columnName `NSString` value of the name of the column. 123 | 124 | @return Zero-based index for column. 125 | */ 126 | 127 | - (int)columnIndexForName:(NSString*)columnName; 128 | 129 | /** Column name for column index 130 | 131 | @param columnIdx Zero-based index for column. 132 | 133 | @return columnName `NSString` value of the name of the column. 134 | */ 135 | 136 | - (NSString*)columnNameForIndex:(int)columnIdx; 137 | 138 | /** Result set integer value for column. 139 | 140 | @param columnName `NSString` value of the name of the column. 141 | 142 | @return `int` value of the result set's column. 143 | */ 144 | 145 | - (int)intForColumn:(NSString*)columnName; 146 | 147 | /** Result set integer value for column. 148 | 149 | @param columnIdx Zero-based index for column. 150 | 151 | @return `int` value of the result set's column. 152 | */ 153 | 154 | - (int)intForColumnIndex:(int)columnIdx; 155 | 156 | /** Result set `long` value for column. 157 | 158 | @param columnName `NSString` value of the name of the column. 159 | 160 | @return `long` value of the result set's column. 161 | */ 162 | 163 | - (long)longForColumn:(NSString*)columnName; 164 | 165 | /** Result set long value for column. 166 | 167 | @param columnIdx Zero-based index for column. 168 | 169 | @return `long` value of the result set's column. 170 | */ 171 | 172 | - (long)longForColumnIndex:(int)columnIdx; 173 | 174 | /** Result set `long long int` value for column. 175 | 176 | @param columnName `NSString` value of the name of the column. 177 | 178 | @return `long long int` value of the result set's column. 179 | */ 180 | 181 | - (long long int)longLongIntForColumn:(NSString*)columnName; 182 | 183 | /** Result set `long long int` value for column. 184 | 185 | @param columnIdx Zero-based index for column. 186 | 187 | @return `long long int` value of the result set's column. 188 | */ 189 | 190 | - (long long int)longLongIntForColumnIndex:(int)columnIdx; 191 | 192 | /** Result set `unsigned long long int` value for column. 193 | 194 | @param columnName `NSString` value of the name of the column. 195 | 196 | @return `unsigned long long int` value of the result set's column. 197 | */ 198 | 199 | - (unsigned long long int)unsignedLongLongIntForColumn:(NSString*)columnName; 200 | 201 | /** Result set `unsigned long long int` value for column. 202 | 203 | @param columnIdx Zero-based index for column. 204 | 205 | @return `unsigned long long int` value of the result set's column. 206 | */ 207 | 208 | - (unsigned long long int)unsignedLongLongIntForColumnIndex:(int)columnIdx; 209 | 210 | /** Result set `BOOL` value for column. 211 | 212 | @param columnName `NSString` value of the name of the column. 213 | 214 | @return `BOOL` value of the result set's column. 215 | */ 216 | 217 | - (BOOL)boolForColumn:(NSString*)columnName; 218 | 219 | /** Result set `BOOL` value for column. 220 | 221 | @param columnIdx Zero-based index for column. 222 | 223 | @return `BOOL` value of the result set's column. 224 | */ 225 | 226 | - (BOOL)boolForColumnIndex:(int)columnIdx; 227 | 228 | /** Result set `double` value for column. 229 | 230 | @param columnName `NSString` value of the name of the column. 231 | 232 | @return `double` value of the result set's column. 233 | 234 | */ 235 | 236 | - (double)doubleForColumn:(NSString*)columnName; 237 | 238 | /** Result set `double` value for column. 239 | 240 | @param columnIdx Zero-based index for column. 241 | 242 | @return `double` value of the result set's column. 243 | 244 | */ 245 | 246 | - (double)doubleForColumnIndex:(int)columnIdx; 247 | 248 | /** Result set `NSString` value for column. 249 | 250 | @param columnName `NSString` value of the name of the column. 251 | 252 | @return `NSString` value of the result set's column. 253 | 254 | */ 255 | 256 | - (NSString*)stringForColumn:(NSString*)columnName; 257 | 258 | /** Result set `NSString` value for column. 259 | 260 | @param columnIdx Zero-based index for column. 261 | 262 | @return `NSString` value of the result set's column. 263 | */ 264 | 265 | - (NSString*)stringForColumnIndex:(int)columnIdx; 266 | 267 | /** Result set `NSDate` value for column. 268 | 269 | @param columnName `NSString` value of the name of the column. 270 | 271 | @return `NSDate` value of the result set's column. 272 | */ 273 | 274 | - (NSDate*)dateForColumn:(NSString*)columnName; 275 | 276 | /** Result set `NSDate` value for column. 277 | 278 | @param columnIdx Zero-based index for column. 279 | 280 | @return `NSDate` value of the result set's column. 281 | 282 | */ 283 | 284 | - (NSDate*)dateForColumnIndex:(int)columnIdx; 285 | 286 | /** Result set `NSData` value for column. 287 | 288 | This is useful when storing binary data in table (such as image or the like). 289 | 290 | @param columnName `NSString` value of the name of the column. 291 | 292 | @return `NSData` value of the result set's column. 293 | 294 | */ 295 | 296 | - (NSData*)dataForColumn:(NSString*)columnName; 297 | 298 | /** Result set `NSData` value for column. 299 | 300 | @param columnIdx Zero-based index for column. 301 | 302 | @return `NSData` value of the result set's column. 303 | */ 304 | 305 | - (NSData*)dataForColumnIndex:(int)columnIdx; 306 | 307 | /** Result set `(const unsigned char *)` value for column. 308 | 309 | @param columnName `NSString` value of the name of the column. 310 | 311 | @return `(const unsigned char *)` value of the result set's column. 312 | */ 313 | 314 | - (const unsigned char *)UTF8StringForColumnName:(NSString*)columnName; 315 | 316 | /** Result set `(const unsigned char *)` value for column. 317 | 318 | @param columnIdx Zero-based index for column. 319 | 320 | @return `(const unsigned char *)` value of the result set's column. 321 | */ 322 | 323 | - (const unsigned char *)UTF8StringForColumnIndex:(int)columnIdx; 324 | 325 | /** Result set object for column. 326 | 327 | @param columnName `NSString` value of the name of the column. 328 | 329 | @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object. 330 | 331 | @see objectForKeyedSubscript: 332 | */ 333 | 334 | - (id)objectForColumnName:(NSString*)columnName; 335 | 336 | /** Result set object for column. 337 | 338 | @param columnIdx Zero-based index for column. 339 | 340 | @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object. 341 | 342 | @see objectAtIndexedSubscript: 343 | */ 344 | 345 | - (id)objectForColumnIndex:(int)columnIdx; 346 | 347 | /** Result set object for column. 348 | 349 | This method allows the use of the "boxed" syntax supported in Modern Objective-C. For example, by defining this method, the following syntax is now supported: 350 | 351 | id result = rs[@"employee_name"]; 352 | 353 | This simplified syntax is equivalent to calling: 354 | 355 | id result = [rs objectForKeyedSubscript:@"employee_name"]; 356 | 357 | which is, it turns out, equivalent to calling: 358 | 359 | id result = [rs objectForColumnName:@"employee_name"]; 360 | 361 | @param columnName `NSString` value of the name of the column. 362 | 363 | @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object. 364 | */ 365 | 366 | - (id)objectForKeyedSubscript:(NSString *)columnName; 367 | 368 | /** Result set object for column. 369 | 370 | This method allows the use of the "boxed" syntax supported in Modern Objective-C. For example, by defining this method, the following syntax is now supported: 371 | 372 | id result = rs[0]; 373 | 374 | This simplified syntax is equivalent to calling: 375 | 376 | id result = [rs objectForKeyedSubscript:0]; 377 | 378 | which is, it turns out, equivalent to calling: 379 | 380 | id result = [rs objectForColumnName:0]; 381 | 382 | @param columnIdx Zero-based index for column. 383 | 384 | @return Either `NSNumber`, `NSString`, `NSData`, or `NSNull`. If the column was `NULL`, this returns `[NSNull null]` object. 385 | */ 386 | 387 | - (id)objectAtIndexedSubscript:(int)columnIdx; 388 | 389 | /** Result set `NSData` value for column. 390 | 391 | @param columnName `NSString` value of the name of the column. 392 | 393 | @return `NSData` value of the result set's column. 394 | 395 | @warning If you are going to use this data after you iterate over the next row, or after you close the 396 | result set, make sure to make a copy of the data first (or just use ``/``) 397 | If you don't, you're going to be in a world of hurt when you try and use the data. 398 | 399 | */ 400 | 401 | - (NSData*)dataNoCopyForColumn:(NSString*)columnName NS_RETURNS_NOT_RETAINED; 402 | 403 | /** Result set `NSData` value for column. 404 | 405 | @param columnIdx Zero-based index for column. 406 | 407 | @return `NSData` value of the result set's column. 408 | 409 | @warning If you are going to use this data after you iterate over the next row, or after you close the 410 | result set, make sure to make a copy of the data first (or just use ``/``) 411 | If you don't, you're going to be in a world of hurt when you try and use the data. 412 | 413 | */ 414 | 415 | - (NSData*)dataNoCopyForColumnIndex:(int)columnIdx NS_RETURNS_NOT_RETAINED; 416 | 417 | /** Is the column `NULL`? 418 | 419 | @param columnIdx Zero-based index for column. 420 | 421 | @return `YES` if column is `NULL`; `NO` if not `NULL`. 422 | */ 423 | 424 | - (BOOL)columnIndexIsNull:(int)columnIdx; 425 | 426 | /** Is the column `NULL`? 427 | 428 | @param columnName `NSString` value of the name of the column. 429 | 430 | @return `YES` if column is `NULL`; `NO` if not `NULL`. 431 | */ 432 | 433 | - (BOOL)columnIsNull:(NSString*)columnName; 434 | 435 | 436 | /** Returns a dictionary of the row results mapped to case sensitive keys of the column names. 437 | 438 | @returns `NSDictionary` of the row results. 439 | 440 | @warning The keys to the dictionary are case sensitive of the column names. 441 | */ 442 | 443 | - (NSDictionary*)resultDictionary; 444 | 445 | /** Returns a dictionary of the row results 446 | 447 | @see resultDictionary 448 | 449 | @warning **Deprecated**: Please use `` instead. Also, beware that `` is case sensitive! 450 | */ 451 | 452 | - (NSDictionary*)resultDict __attribute__ ((deprecated)); 453 | 454 | ///----------------------------- 455 | /// @name Key value coding magic 456 | ///----------------------------- 457 | 458 | /** Performs `setValue` to yield support for key value observing. 459 | 460 | @param object The object for which the values will be set. This is the key-value-coding compliant object that you might, for example, observe. 461 | 462 | */ 463 | 464 | - (void)kvcMagic:(id)object; 465 | 466 | 467 | @end 468 | 469 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/FMDB/src/fmdb/FMResultSet.m: -------------------------------------------------------------------------------- 1 | #import "FMResultSet.h" 2 | #import "FMDatabase.h" 3 | #import "unistd.h" 4 | 5 | #if FMDB_SQLITE_STANDALONE 6 | #import 7 | #else 8 | #import 9 | #endif 10 | 11 | @interface FMDatabase () 12 | - (void)resultSetDidClose:(FMResultSet *)resultSet; 13 | @end 14 | 15 | 16 | @implementation FMResultSet 17 | @synthesize query=_query; 18 | @synthesize statement=_statement; 19 | 20 | + (instancetype)resultSetWithStatement:(FMStatement *)statement usingParentDatabase:(FMDatabase*)aDB { 21 | 22 | FMResultSet *rs = [[FMResultSet alloc] init]; 23 | 24 | [rs setStatement:statement]; 25 | [rs setParentDB:aDB]; 26 | 27 | NSParameterAssert(![statement inUse]); 28 | [statement setInUse:YES]; // weak reference 29 | 30 | return FMDBReturnAutoreleased(rs); 31 | } 32 | 33 | - (void)finalize { 34 | [self close]; 35 | [super finalize]; 36 | } 37 | 38 | - (void)dealloc { 39 | [self close]; 40 | 41 | FMDBRelease(_query); 42 | _query = nil; 43 | 44 | FMDBRelease(_columnNameToIndexMap); 45 | _columnNameToIndexMap = nil; 46 | 47 | #if ! __has_feature(objc_arc) 48 | [super dealloc]; 49 | #endif 50 | } 51 | 52 | - (void)close { 53 | [_statement reset]; 54 | FMDBRelease(_statement); 55 | _statement = nil; 56 | 57 | // we don't need this anymore... (i think) 58 | //[_parentDB setInUse:NO]; 59 | [_parentDB resultSetDidClose:self]; 60 | _parentDB = nil; 61 | } 62 | 63 | - (int)columnCount { 64 | return sqlite3_column_count([_statement statement]); 65 | } 66 | 67 | - (NSMutableDictionary *)columnNameToIndexMap { 68 | if (!_columnNameToIndexMap) { 69 | int columnCount = sqlite3_column_count([_statement statement]); 70 | _columnNameToIndexMap = [[NSMutableDictionary alloc] initWithCapacity:(NSUInteger)columnCount]; 71 | int columnIdx = 0; 72 | for (columnIdx = 0; columnIdx < columnCount; columnIdx++) { 73 | [_columnNameToIndexMap setObject:[NSNumber numberWithInt:columnIdx] 74 | forKey:[[NSString stringWithUTF8String:sqlite3_column_name([_statement statement], columnIdx)] lowercaseString]]; 75 | } 76 | } 77 | return _columnNameToIndexMap; 78 | } 79 | 80 | - (void)kvcMagic:(id)object { 81 | 82 | int columnCount = sqlite3_column_count([_statement statement]); 83 | 84 | int columnIdx = 0; 85 | for (columnIdx = 0; columnIdx < columnCount; columnIdx++) { 86 | 87 | const char *c = (const char *)sqlite3_column_text([_statement statement], columnIdx); 88 | 89 | // check for a null row 90 | if (c) { 91 | NSString *s = [NSString stringWithUTF8String:c]; 92 | 93 | [object setValue:s forKey:[NSString stringWithUTF8String:sqlite3_column_name([_statement statement], columnIdx)]]; 94 | } 95 | } 96 | } 97 | 98 | #pragma clang diagnostic push 99 | #pragma clang diagnostic ignored "-Wdeprecated-implementations" 100 | 101 | - (NSDictionary*)resultDict { 102 | 103 | NSUInteger num_cols = (NSUInteger)sqlite3_data_count([_statement statement]); 104 | 105 | if (num_cols > 0) { 106 | NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:num_cols]; 107 | 108 | NSEnumerator *columnNames = [[self columnNameToIndexMap] keyEnumerator]; 109 | NSString *columnName = nil; 110 | while ((columnName = [columnNames nextObject])) { 111 | id objectValue = [self objectForColumnName:columnName]; 112 | [dict setObject:objectValue forKey:columnName]; 113 | } 114 | 115 | return FMDBReturnAutoreleased([dict copy]); 116 | } 117 | else { 118 | NSLog(@"Warning: There seem to be no columns in this set."); 119 | } 120 | 121 | return nil; 122 | } 123 | 124 | #pragma clang diagnostic pop 125 | 126 | - (NSDictionary*)resultDictionary { 127 | 128 | NSUInteger num_cols = (NSUInteger)sqlite3_data_count([_statement statement]); 129 | 130 | if (num_cols > 0) { 131 | NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:num_cols]; 132 | 133 | int columnCount = sqlite3_column_count([_statement statement]); 134 | 135 | int columnIdx = 0; 136 | for (columnIdx = 0; columnIdx < columnCount; columnIdx++) { 137 | 138 | NSString *columnName = [NSString stringWithUTF8String:sqlite3_column_name([_statement statement], columnIdx)]; 139 | id objectValue = [self objectForColumnIndex:columnIdx]; 140 | [dict setObject:objectValue forKey:columnName]; 141 | } 142 | 143 | return dict; 144 | } 145 | else { 146 | NSLog(@"Warning: There seem to be no columns in this set."); 147 | } 148 | 149 | return nil; 150 | } 151 | 152 | 153 | 154 | 155 | - (BOOL)next { 156 | return [self nextWithError:nil]; 157 | } 158 | 159 | - (BOOL)nextWithError:(NSError **)outErr { 160 | 161 | int rc = sqlite3_step([_statement statement]); 162 | 163 | if (SQLITE_BUSY == rc || SQLITE_LOCKED == rc) { 164 | NSLog(@"%s:%d Database busy (%@)", __FUNCTION__, __LINE__, [_parentDB databasePath]); 165 | NSLog(@"Database busy"); 166 | if (outErr) { 167 | *outErr = [_parentDB lastError]; 168 | } 169 | } 170 | else if (SQLITE_DONE == rc || SQLITE_ROW == rc) { 171 | // all is well, let's return. 172 | } 173 | else if (SQLITE_ERROR == rc) { 174 | NSLog(@"Error calling sqlite3_step (%d: %s) rs", rc, sqlite3_errmsg([_parentDB sqliteHandle])); 175 | if (outErr) { 176 | *outErr = [_parentDB lastError]; 177 | } 178 | } 179 | else if (SQLITE_MISUSE == rc) { 180 | // uh oh. 181 | NSLog(@"Error calling sqlite3_step (%d: %s) rs", rc, sqlite3_errmsg([_parentDB sqliteHandle])); 182 | if (outErr) { 183 | if (_parentDB) { 184 | *outErr = [_parentDB lastError]; 185 | } 186 | else { 187 | // If 'next' or 'nextWithError' is called after the result set is closed, 188 | // we need to return the appropriate error. 189 | NSDictionary* errorMessage = [NSDictionary dictionaryWithObject:@"parentDB does not exist" forKey:NSLocalizedDescriptionKey]; 190 | *outErr = [NSError errorWithDomain:@"FMDatabase" code:SQLITE_MISUSE userInfo:errorMessage]; 191 | } 192 | 193 | } 194 | } 195 | else { 196 | // wtf? 197 | NSLog(@"Unknown error calling sqlite3_step (%d: %s) rs", rc, sqlite3_errmsg([_parentDB sqliteHandle])); 198 | if (outErr) { 199 | *outErr = [_parentDB lastError]; 200 | } 201 | } 202 | 203 | 204 | if (rc != SQLITE_ROW) { 205 | [self close]; 206 | } 207 | 208 | return (rc == SQLITE_ROW); 209 | } 210 | 211 | - (BOOL)hasAnotherRow { 212 | return sqlite3_errcode([_parentDB sqliteHandle]) == SQLITE_ROW; 213 | } 214 | 215 | - (int)columnIndexForName:(NSString*)columnName { 216 | columnName = [columnName lowercaseString]; 217 | 218 | NSNumber *n = [[self columnNameToIndexMap] objectForKey:columnName]; 219 | 220 | if (n) { 221 | return [n intValue]; 222 | } 223 | 224 | NSLog(@"Warning: I could not find the column named '%@'.", columnName); 225 | 226 | return -1; 227 | } 228 | 229 | 230 | 231 | - (int)intForColumn:(NSString*)columnName { 232 | return [self intForColumnIndex:[self columnIndexForName:columnName]]; 233 | } 234 | 235 | - (int)intForColumnIndex:(int)columnIdx { 236 | return sqlite3_column_int([_statement statement], columnIdx); 237 | } 238 | 239 | - (long)longForColumn:(NSString*)columnName { 240 | return [self longForColumnIndex:[self columnIndexForName:columnName]]; 241 | } 242 | 243 | - (long)longForColumnIndex:(int)columnIdx { 244 | return (long)sqlite3_column_int64([_statement statement], columnIdx); 245 | } 246 | 247 | - (long long int)longLongIntForColumn:(NSString*)columnName { 248 | return [self longLongIntForColumnIndex:[self columnIndexForName:columnName]]; 249 | } 250 | 251 | - (long long int)longLongIntForColumnIndex:(int)columnIdx { 252 | return sqlite3_column_int64([_statement statement], columnIdx); 253 | } 254 | 255 | - (unsigned long long int)unsignedLongLongIntForColumn:(NSString*)columnName { 256 | return [self unsignedLongLongIntForColumnIndex:[self columnIndexForName:columnName]]; 257 | } 258 | 259 | - (unsigned long long int)unsignedLongLongIntForColumnIndex:(int)columnIdx { 260 | return (unsigned long long int)[self longLongIntForColumnIndex:columnIdx]; 261 | } 262 | 263 | - (BOOL)boolForColumn:(NSString*)columnName { 264 | return [self boolForColumnIndex:[self columnIndexForName:columnName]]; 265 | } 266 | 267 | - (BOOL)boolForColumnIndex:(int)columnIdx { 268 | return ([self intForColumnIndex:columnIdx] != 0); 269 | } 270 | 271 | - (double)doubleForColumn:(NSString*)columnName { 272 | return [self doubleForColumnIndex:[self columnIndexForName:columnName]]; 273 | } 274 | 275 | - (double)doubleForColumnIndex:(int)columnIdx { 276 | return sqlite3_column_double([_statement statement], columnIdx); 277 | } 278 | 279 | - (NSString*)stringForColumnIndex:(int)columnIdx { 280 | 281 | if (sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL || (columnIdx < 0)) { 282 | return nil; 283 | } 284 | 285 | const char *c = (const char *)sqlite3_column_text([_statement statement], columnIdx); 286 | 287 | if (!c) { 288 | // null row. 289 | return nil; 290 | } 291 | 292 | return [NSString stringWithUTF8String:c]; 293 | } 294 | 295 | - (NSString*)stringForColumn:(NSString*)columnName { 296 | return [self stringForColumnIndex:[self columnIndexForName:columnName]]; 297 | } 298 | 299 | - (NSDate*)dateForColumn:(NSString*)columnName { 300 | return [self dateForColumnIndex:[self columnIndexForName:columnName]]; 301 | } 302 | 303 | - (NSDate*)dateForColumnIndex:(int)columnIdx { 304 | 305 | if (sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL || (columnIdx < 0)) { 306 | return nil; 307 | } 308 | 309 | return [_parentDB hasDateFormatter] ? [_parentDB dateFromString:[self stringForColumnIndex:columnIdx]] : [NSDate dateWithTimeIntervalSince1970:[self doubleForColumnIndex:columnIdx]]; 310 | } 311 | 312 | 313 | - (NSData*)dataForColumn:(NSString*)columnName { 314 | return [self dataForColumnIndex:[self columnIndexForName:columnName]]; 315 | } 316 | 317 | - (NSData*)dataForColumnIndex:(int)columnIdx { 318 | 319 | if (sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL || (columnIdx < 0)) { 320 | return nil; 321 | } 322 | 323 | const char *dataBuffer = sqlite3_column_blob([_statement statement], columnIdx); 324 | int dataSize = sqlite3_column_bytes([_statement statement], columnIdx); 325 | 326 | if (dataBuffer == NULL) { 327 | return nil; 328 | } 329 | 330 | return [NSData dataWithBytes:(const void *)dataBuffer length:(NSUInteger)dataSize]; 331 | } 332 | 333 | 334 | - (NSData*)dataNoCopyForColumn:(NSString*)columnName { 335 | return [self dataNoCopyForColumnIndex:[self columnIndexForName:columnName]]; 336 | } 337 | 338 | - (NSData*)dataNoCopyForColumnIndex:(int)columnIdx { 339 | 340 | if (sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL || (columnIdx < 0)) { 341 | return nil; 342 | } 343 | 344 | const char *dataBuffer = sqlite3_column_blob([_statement statement], columnIdx); 345 | int dataSize = sqlite3_column_bytes([_statement statement], columnIdx); 346 | 347 | NSData *data = [NSData dataWithBytesNoCopy:(void *)dataBuffer length:(NSUInteger)dataSize freeWhenDone:NO]; 348 | 349 | return data; 350 | } 351 | 352 | 353 | - (BOOL)columnIndexIsNull:(int)columnIdx { 354 | return sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL; 355 | } 356 | 357 | - (BOOL)columnIsNull:(NSString*)columnName { 358 | return [self columnIndexIsNull:[self columnIndexForName:columnName]]; 359 | } 360 | 361 | - (const unsigned char *)UTF8StringForColumnIndex:(int)columnIdx { 362 | 363 | if (sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL || (columnIdx < 0)) { 364 | return nil; 365 | } 366 | 367 | return sqlite3_column_text([_statement statement], columnIdx); 368 | } 369 | 370 | - (const unsigned char *)UTF8StringForColumnName:(NSString*)columnName { 371 | return [self UTF8StringForColumnIndex:[self columnIndexForName:columnName]]; 372 | } 373 | 374 | - (id)objectForColumnIndex:(int)columnIdx { 375 | int columnType = sqlite3_column_type([_statement statement], columnIdx); 376 | 377 | id returnValue = nil; 378 | 379 | if (columnType == SQLITE_INTEGER) { 380 | returnValue = [NSNumber numberWithLongLong:[self longLongIntForColumnIndex:columnIdx]]; 381 | } 382 | else if (columnType == SQLITE_FLOAT) { 383 | returnValue = [NSNumber numberWithDouble:[self doubleForColumnIndex:columnIdx]]; 384 | } 385 | else if (columnType == SQLITE_BLOB) { 386 | returnValue = [self dataForColumnIndex:columnIdx]; 387 | } 388 | else { 389 | //default to a string for everything else 390 | returnValue = [self stringForColumnIndex:columnIdx]; 391 | } 392 | 393 | if (returnValue == nil) { 394 | returnValue = [NSNull null]; 395 | } 396 | 397 | return returnValue; 398 | } 399 | 400 | - (id)objectForColumnName:(NSString*)columnName { 401 | return [self objectForColumnIndex:[self columnIndexForName:columnName]]; 402 | } 403 | 404 | // returns autoreleased NSString containing the name of the column in the result set 405 | - (NSString*)columnNameForIndex:(int)columnIdx { 406 | return [NSString stringWithUTF8String: sqlite3_column_name([_statement statement], columnIdx)]; 407 | } 408 | 409 | - (void)setParentDB:(FMDatabase *)newDb { 410 | _parentDB = newDb; 411 | } 412 | 413 | - (id)objectAtIndexedSubscript:(int)columnIdx { 414 | return [self objectForColumnIndex:columnIdx]; 415 | } 416 | 417 | - (id)objectForKeyedSubscript:(NSString *)columnName { 418 | return [self objectForColumnName:columnName]; 419 | } 420 | 421 | 422 | @end 423 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Private/FMDB/FMDB.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDB.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Private/FMDB/FMDatabase.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabase.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Private/FMDB/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseAdditions.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Private/FMDB/FMDatabasePool.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabasePool.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Private/FMDB/FMDatabaseQueue.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseQueue.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Private/FMDB/FMResultSet.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMResultSet.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Public/FMDB/FMDB.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDB.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Public/FMDB/FMDatabase.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabase.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Public/FMDB/FMDatabaseAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseAdditions.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Public/FMDB/FMDatabasePool.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabasePool.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Public/FMDB/FMDatabaseQueue.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMDatabaseQueue.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Headers/Public/FMDB/FMResultSet.h: -------------------------------------------------------------------------------- 1 | ../../../FMDB/src/fmdb/FMResultSet.h -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FMDB (2.6.2): 3 | - FMDB/standard (= 2.6.2) 4 | - FMDB/standard (2.6.2) 5 | 6 | DEPENDENCIES: 7 | - FMDB 8 | 9 | SPEC CHECKSUMS: 10 | FMDB: 854a0341b4726e53276f2a8996f06f1b80f9259a 11 | 12 | PODFILE CHECKSUM: 7b974b2a722b0021c3858ec7235c91cc0e29bbf3 13 | 14 | COCOAPODS: 1.0.1 15 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0EF8E9AA652DBE2745A7D5C8CD2E3BDE /* FMDatabasePool.m in Sources */ = {isa = PBXBuildFile; fileRef = 400AFB42920EB39709666D3F1A73D6C2 /* FMDatabasePool.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 11 | 0F8A8E0D6FAEBF758E0B4D620335F094 /* FMDatabasePool.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AF3AEDDA16DD8E28B59FF0788FDDC03 /* FMDatabasePool.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 282081E035E7A843068E8BCC2E07C217 /* FMDatabaseQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = C11A8F38580C7A7FF38ACB6A3B412884 /* FMDatabaseQueue.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 13 | 2EE377E8447309408DDDCAB89661F902 /* Pods-JWDFMDB-Data-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 114C8633D0068BE4358D7F64363116EE /* Pods-JWDFMDB-Data-dummy.m */; }; 14 | 313531CEDA0294311D87B4F4C3F073F4 /* FMDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 91893D40185E0EFA40FC217BE44A7C0D /* FMDB.h */; settings = {ATTRIBUTES = (Public, ); }; }; 15 | 3D0F69C4CA35EB6A1F686BA88B19B4F6 /* FMDB-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D76813CB39ACC402A9EE3DC12B4E682 /* FMDB-dummy.m */; }; 16 | A350C5704A1F233DAD830E081E00F8C1 /* FMDatabaseAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BCC0EED53ED8D7C1931178E0E4269B4 /* FMDatabaseAdditions.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 17 | A561A67BF274ABC8C70A4FFA23D56C59 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; 18 | A57526282EE077A917986A2F4F211C80 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; 19 | B418C9BDCF8C6BAC2E3942F157BB6D4C /* FMDatabaseAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = D2DD52CB174E1DC79111C38E770F6FC8 /* FMDatabaseAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 20 | CA027706DD6805766F1F4EC548E72440 /* FMDatabase.m in Sources */ = {isa = PBXBuildFile; fileRef = DC7C30F9E55829B027C4913D1F19D68C /* FMDatabase.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 21 | D0C5FF5485EAA2CDA03E9796B407697A /* FMDatabaseQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 33F15B71183AD666DFC49D907F769ACF /* FMDatabaseQueue.h */; settings = {ATTRIBUTES = (Public, ); }; }; 22 | D0D5FFE53407F16C9CD3D0ECF43ACE93 /* FMDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 638E465E4B27490B0FB423614C3ADD11 /* FMDatabase.h */; settings = {ATTRIBUTES = (Public, ); }; }; 23 | DEFA3504695E9DFDE1177DAB22884470 /* FMResultSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 71B69D4A7150AC2F65A57B7D04F092D4 /* FMResultSet.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; 24 | F977B243321331B58666E9284634101A /* FMResultSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 69CC8B63F837EA7B053AB8BA07253A25 /* FMResultSet.h */; settings = {ATTRIBUTES = (Public, ); }; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | F86C151B7D351277DCDB9A72FE7120B7 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 9F12FB4A63E20F601CFB2E64A65B57C1; 33 | remoteInfo = FMDB; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 114C8633D0068BE4358D7F64363116EE /* Pods-JWDFMDB-Data-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-JWDFMDB-Data-dummy.m"; sourceTree = ""; }; 39 | 1AF3AEDDA16DD8E28B59FF0788FDDC03 /* FMDatabasePool.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabasePool.h; path = src/fmdb/FMDatabasePool.h; sourceTree = ""; }; 40 | 2E1D3B67A5AA8D299A0B1734EB7CCB30 /* Pods-JWDFMDB-Data-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-JWDFMDB-Data-acknowledgements.plist"; sourceTree = ""; }; 41 | 33F15B71183AD666DFC49D907F769ACF /* FMDatabaseQueue.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabaseQueue.h; path = src/fmdb/FMDatabaseQueue.h; sourceTree = ""; }; 42 | 3BCC0EED53ED8D7C1931178E0E4269B4 /* FMDatabaseAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabaseAdditions.m; path = src/fmdb/FMDatabaseAdditions.m; sourceTree = ""; }; 43 | 400AFB42920EB39709666D3F1A73D6C2 /* FMDatabasePool.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabasePool.m; path = src/fmdb/FMDatabasePool.m; sourceTree = ""; }; 44 | 638E465E4B27490B0FB423614C3ADD11 /* FMDatabase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabase.h; path = src/fmdb/FMDatabase.h; sourceTree = ""; }; 45 | 69CC8B63F837EA7B053AB8BA07253A25 /* FMResultSet.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMResultSet.h; path = src/fmdb/FMResultSet.h; sourceTree = ""; }; 46 | 6D76813CB39ACC402A9EE3DC12B4E682 /* FMDB-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "FMDB-dummy.m"; sourceTree = ""; }; 47 | 6F018EAD469B7A34751A9072A1C883A3 /* Pods-JWDFMDB-Data.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-JWDFMDB-Data.debug.xcconfig"; sourceTree = ""; }; 48 | 71978CCC9944AF1A5A600536BE845466 /* libPods-JWDFMDB-Data.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JWDFMDB-Data.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 71B69D4A7150AC2F65A57B7D04F092D4 /* FMResultSet.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMResultSet.m; path = src/fmdb/FMResultSet.m; sourceTree = ""; }; 50 | 91893D40185E0EFA40FC217BE44A7C0D /* FMDB.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDB.h; path = src/fmdb/FMDB.h; sourceTree = ""; }; 51 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 52 | 98A0808A13F8C3D2B179224A4F0EC681 /* Pods-JWDFMDB-Data-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-JWDFMDB-Data-acknowledgements.markdown"; sourceTree = ""; }; 53 | A1448204AE8E2DC37C8C36438BED7AD8 /* FMDB-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "FMDB-prefix.pch"; sourceTree = ""; }; 54 | B2AC8D08AB9E95E701EC049C53414AEB /* FMDB.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = FMDB.xcconfig; sourceTree = ""; }; 55 | BF3BCB51AFA85269480E10CFC1ED4CEB /* Pods-JWDFMDB-Data-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-JWDFMDB-Data-frameworks.sh"; sourceTree = ""; }; 56 | C11A8F38580C7A7FF38ACB6A3B412884 /* FMDatabaseQueue.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabaseQueue.m; path = src/fmdb/FMDatabaseQueue.m; sourceTree = ""; }; 57 | C99EB35E80E0C78AE37D8723A2DC67B0 /* Pods-JWDFMDB-Data-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-JWDFMDB-Data-resources.sh"; sourceTree = ""; }; 58 | CD28B22311D0C41D476D0E6664441F99 /* Pods-JWDFMDB-Data.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-JWDFMDB-Data.release.xcconfig"; sourceTree = ""; }; 59 | CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 60 | D2DD52CB174E1DC79111C38E770F6FC8 /* FMDatabaseAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = FMDatabaseAdditions.h; path = src/fmdb/FMDatabaseAdditions.h; sourceTree = ""; }; 61 | D6DFCD42D7A0F2F4467906958DAAB085 /* libFMDB.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libFMDB.a; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | DC7C30F9E55829B027C4913D1F19D68C /* FMDatabase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = FMDatabase.m; path = src/fmdb/FMDatabase.m; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 84AF63084FFE4472EFC6131BD113B13D /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | A561A67BF274ABC8C70A4FFA23D56C59 /* Foundation.framework in Frameworks */, 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | AED6EB2BCFAFE5D5042F33262CE7C6F6 /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | A57526282EE077A917986A2F4F211C80 /* Foundation.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */, 89 | ); 90 | name = iOS; 91 | sourceTree = ""; 92 | }; 93 | 6A65CEB166911CC900621A37BC272B1F /* Support Files */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | B2AC8D08AB9E95E701EC049C53414AEB /* FMDB.xcconfig */, 97 | 6D76813CB39ACC402A9EE3DC12B4E682 /* FMDB-dummy.m */, 98 | A1448204AE8E2DC37C8C36438BED7AD8 /* FMDB-prefix.pch */, 99 | ); 100 | name = "Support Files"; 101 | path = "../Target Support Files/FMDB"; 102 | sourceTree = ""; 103 | }; 104 | 7DB346D0F39D3F0E887471402A8071AB = { 105 | isa = PBXGroup; 106 | children = ( 107 | 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, 108 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, 109 | BFB8C92E749ED180124155E2270474D2 /* Pods */, 110 | 824CC212E23B0CBCB236AD3C00E26809 /* Products */, 111 | 9C56DF378E3B9F53EDF383268C183A55 /* Targets Support Files */, 112 | ); 113 | sourceTree = ""; 114 | }; 115 | 7E0823B8A9CDD4FD90E5B09726EF8F79 /* Pods-JWDFMDB-Data */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 98A0808A13F8C3D2B179224A4F0EC681 /* Pods-JWDFMDB-Data-acknowledgements.markdown */, 119 | 2E1D3B67A5AA8D299A0B1734EB7CCB30 /* Pods-JWDFMDB-Data-acknowledgements.plist */, 120 | 114C8633D0068BE4358D7F64363116EE /* Pods-JWDFMDB-Data-dummy.m */, 121 | BF3BCB51AFA85269480E10CFC1ED4CEB /* Pods-JWDFMDB-Data-frameworks.sh */, 122 | C99EB35E80E0C78AE37D8723A2DC67B0 /* Pods-JWDFMDB-Data-resources.sh */, 123 | 6F018EAD469B7A34751A9072A1C883A3 /* Pods-JWDFMDB-Data.debug.xcconfig */, 124 | CD28B22311D0C41D476D0E6664441F99 /* Pods-JWDFMDB-Data.release.xcconfig */, 125 | ); 126 | name = "Pods-JWDFMDB-Data"; 127 | path = "Target Support Files/Pods-JWDFMDB-Data"; 128 | sourceTree = ""; 129 | }; 130 | 824CC212E23B0CBCB236AD3C00E26809 /* Products */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | D6DFCD42D7A0F2F4467906958DAAB085 /* libFMDB.a */, 134 | 71978CCC9944AF1A5A600536BE845466 /* libPods-JWDFMDB-Data.a */, 135 | ); 136 | name = Products; 137 | sourceTree = ""; 138 | }; 139 | 9C56DF378E3B9F53EDF383268C183A55 /* Targets Support Files */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 7E0823B8A9CDD4FD90E5B09726EF8F79 /* Pods-JWDFMDB-Data */, 143 | ); 144 | name = "Targets Support Files"; 145 | sourceTree = ""; 146 | }; 147 | BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */, 151 | ); 152 | name = Frameworks; 153 | sourceTree = ""; 154 | }; 155 | BFB8C92E749ED180124155E2270474D2 /* Pods */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | DEA37EDFE575D4B41E183255F5C2B8C8 /* FMDB */, 159 | ); 160 | name = Pods; 161 | sourceTree = ""; 162 | }; 163 | C89A6930D6DE6039F840782BFE7A2DFB /* standard */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 638E465E4B27490B0FB423614C3ADD11 /* FMDatabase.h */, 167 | DC7C30F9E55829B027C4913D1F19D68C /* FMDatabase.m */, 168 | D2DD52CB174E1DC79111C38E770F6FC8 /* FMDatabaseAdditions.h */, 169 | 3BCC0EED53ED8D7C1931178E0E4269B4 /* FMDatabaseAdditions.m */, 170 | 1AF3AEDDA16DD8E28B59FF0788FDDC03 /* FMDatabasePool.h */, 171 | 400AFB42920EB39709666D3F1A73D6C2 /* FMDatabasePool.m */, 172 | 33F15B71183AD666DFC49D907F769ACF /* FMDatabaseQueue.h */, 173 | C11A8F38580C7A7FF38ACB6A3B412884 /* FMDatabaseQueue.m */, 174 | 91893D40185E0EFA40FC217BE44A7C0D /* FMDB.h */, 175 | 69CC8B63F837EA7B053AB8BA07253A25 /* FMResultSet.h */, 176 | 71B69D4A7150AC2F65A57B7D04F092D4 /* FMResultSet.m */, 177 | ); 178 | name = standard; 179 | sourceTree = ""; 180 | }; 181 | DEA37EDFE575D4B41E183255F5C2B8C8 /* FMDB */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | C89A6930D6DE6039F840782BFE7A2DFB /* standard */, 185 | 6A65CEB166911CC900621A37BC272B1F /* Support Files */, 186 | ); 187 | path = FMDB; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXGroup section */ 191 | 192 | /* Begin PBXHeadersBuildPhase section */ 193 | 8B2D82357BE4C2A10AB2CD4724B8E654 /* Headers */ = { 194 | isa = PBXHeadersBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | D0D5FFE53407F16C9CD3D0ECF43ACE93 /* FMDatabase.h in Headers */, 198 | B418C9BDCF8C6BAC2E3942F157BB6D4C /* FMDatabaseAdditions.h in Headers */, 199 | 0F8A8E0D6FAEBF758E0B4D620335F094 /* FMDatabasePool.h in Headers */, 200 | D0C5FF5485EAA2CDA03E9796B407697A /* FMDatabaseQueue.h in Headers */, 201 | 313531CEDA0294311D87B4F4C3F073F4 /* FMDB.h in Headers */, 202 | F977B243321331B58666E9284634101A /* FMResultSet.h in Headers */, 203 | ); 204 | runOnlyForDeploymentPostprocessing = 0; 205 | }; 206 | /* End PBXHeadersBuildPhase section */ 207 | 208 | /* Begin PBXNativeTarget section */ 209 | 1AE22CE23E600844870CA6152F101866 /* Pods-JWDFMDB-Data */ = { 210 | isa = PBXNativeTarget; 211 | buildConfigurationList = F2CFCD215A396E15EACBD5E4A86DC21C /* Build configuration list for PBXNativeTarget "Pods-JWDFMDB-Data" */; 212 | buildPhases = ( 213 | 07579AC35EBE1A45C8B291DEF466E8C4 /* Sources */, 214 | AED6EB2BCFAFE5D5042F33262CE7C6F6 /* Frameworks */, 215 | ); 216 | buildRules = ( 217 | ); 218 | dependencies = ( 219 | 843FE327438AB7BC8FF3AC9DD9BDC2F0 /* PBXTargetDependency */, 220 | ); 221 | name = "Pods-JWDFMDB-Data"; 222 | productName = "Pods-JWDFMDB-Data"; 223 | productReference = 71978CCC9944AF1A5A600536BE845466 /* libPods-JWDFMDB-Data.a */; 224 | productType = "com.apple.product-type.library.static"; 225 | }; 226 | 9F12FB4A63E20F601CFB2E64A65B57C1 /* FMDB */ = { 227 | isa = PBXNativeTarget; 228 | buildConfigurationList = 3AC899FD215914230EB9D8B57AD910D0 /* Build configuration list for PBXNativeTarget "FMDB" */; 229 | buildPhases = ( 230 | 050B66E154969A68944942A22BD9B314 /* Sources */, 231 | 84AF63084FFE4472EFC6131BD113B13D /* Frameworks */, 232 | 8B2D82357BE4C2A10AB2CD4724B8E654 /* Headers */, 233 | ); 234 | buildRules = ( 235 | ); 236 | dependencies = ( 237 | ); 238 | name = FMDB; 239 | productName = FMDB; 240 | productReference = D6DFCD42D7A0F2F4467906958DAAB085 /* libFMDB.a */; 241 | productType = "com.apple.product-type.library.static"; 242 | }; 243 | /* End PBXNativeTarget section */ 244 | 245 | /* Begin PBXProject section */ 246 | D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { 247 | isa = PBXProject; 248 | attributes = { 249 | LastSwiftUpdateCheck = 0730; 250 | LastUpgradeCheck = 0700; 251 | }; 252 | buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; 253 | compatibilityVersion = "Xcode 3.2"; 254 | developmentRegion = English; 255 | hasScannedForEncodings = 0; 256 | knownRegions = ( 257 | en, 258 | ); 259 | mainGroup = 7DB346D0F39D3F0E887471402A8071AB; 260 | productRefGroup = 824CC212E23B0CBCB236AD3C00E26809 /* Products */; 261 | projectDirPath = ""; 262 | projectRoot = ""; 263 | targets = ( 264 | 9F12FB4A63E20F601CFB2E64A65B57C1 /* FMDB */, 265 | 1AE22CE23E600844870CA6152F101866 /* Pods-JWDFMDB-Data */, 266 | ); 267 | }; 268 | /* End PBXProject section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 050B66E154969A68944942A22BD9B314 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | CA027706DD6805766F1F4EC548E72440 /* FMDatabase.m in Sources */, 276 | A350C5704A1F233DAD830E081E00F8C1 /* FMDatabaseAdditions.m in Sources */, 277 | 0EF8E9AA652DBE2745A7D5C8CD2E3BDE /* FMDatabasePool.m in Sources */, 278 | 282081E035E7A843068E8BCC2E07C217 /* FMDatabaseQueue.m in Sources */, 279 | 3D0F69C4CA35EB6A1F686BA88B19B4F6 /* FMDB-dummy.m in Sources */, 280 | DEFA3504695E9DFDE1177DAB22884470 /* FMResultSet.m in Sources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | 07579AC35EBE1A45C8B291DEF466E8C4 /* Sources */ = { 285 | isa = PBXSourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 2EE377E8447309408DDDCAB89661F902 /* Pods-JWDFMDB-Data-dummy.m in Sources */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXSourcesBuildPhase section */ 293 | 294 | /* Begin PBXTargetDependency section */ 295 | 843FE327438AB7BC8FF3AC9DD9BDC2F0 /* PBXTargetDependency */ = { 296 | isa = PBXTargetDependency; 297 | name = FMDB; 298 | target = 9F12FB4A63E20F601CFB2E64A65B57C1 /* FMDB */; 299 | targetProxy = F86C151B7D351277DCDB9A72FE7120B7 /* PBXContainerItemProxy */; 300 | }; 301 | /* End PBXTargetDependency section */ 302 | 303 | /* Begin XCBuildConfiguration section */ 304 | 0BC8ACAA1BBCD83153EF57E2B89FB594 /* Debug */ = { 305 | isa = XCBuildConfiguration; 306 | baseConfigurationReference = B2AC8D08AB9E95E701EC049C53414AEB /* FMDB.xcconfig */; 307 | buildSettings = { 308 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 309 | DEBUG_INFORMATION_FORMAT = dwarf; 310 | ENABLE_STRICT_OBJC_MSGSEND = YES; 311 | GCC_NO_COMMON_BLOCKS = YES; 312 | GCC_PREFIX_HEADER = "Target Support Files/FMDB/FMDB-prefix.pch"; 313 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 314 | MTL_ENABLE_DEBUG_INFO = YES; 315 | OTHER_LDFLAGS = ""; 316 | OTHER_LIBTOOLFLAGS = ""; 317 | PRIVATE_HEADERS_FOLDER_PATH = ""; 318 | PRODUCT_NAME = "$(TARGET_NAME)"; 319 | PUBLIC_HEADERS_FOLDER_PATH = ""; 320 | SDKROOT = iphoneos; 321 | SKIP_INSTALL = YES; 322 | }; 323 | name = Debug; 324 | }; 325 | 42287DDF97330524BA3EF220F0276DA6 /* Release */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_ANALYZER_NONNULL = YES; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 341 | CLANG_WARN_UNREACHABLE_CODE = YES; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | COPY_PHASE_STRIP = YES; 344 | ENABLE_NS_ASSERTIONS = NO; 345 | GCC_C_LANGUAGE_STANDARD = gnu99; 346 | GCC_PREPROCESSOR_DEFINITIONS = ( 347 | "POD_CONFIGURATION_RELEASE=1", 348 | "$(inherited)", 349 | ); 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 357 | STRIP_INSTALLED_PRODUCT = NO; 358 | SYMROOT = "${SRCROOT}/../build"; 359 | VALIDATE_PRODUCT = YES; 360 | }; 361 | name = Release; 362 | }; 363 | AE9439C22469D35336242DD983DB5C5F /* Debug */ = { 364 | isa = XCBuildConfiguration; 365 | buildSettings = { 366 | ALWAYS_SEARCH_USER_PATHS = NO; 367 | CLANG_ANALYZER_NONNULL = YES; 368 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 369 | CLANG_CXX_LIBRARY = "libc++"; 370 | CLANG_ENABLE_MODULES = YES; 371 | CLANG_ENABLE_OBJC_ARC = YES; 372 | CLANG_WARN_BOOL_CONVERSION = YES; 373 | CLANG_WARN_CONSTANT_CONVERSION = YES; 374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; 375 | CLANG_WARN_EMPTY_BODY = YES; 376 | CLANG_WARN_ENUM_CONVERSION = YES; 377 | CLANG_WARN_INT_CONVERSION = YES; 378 | CLANG_WARN_OBJC_ROOT_CLASS = YES; 379 | CLANG_WARN_UNREACHABLE_CODE = YES; 380 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 381 | COPY_PHASE_STRIP = NO; 382 | ENABLE_TESTABILITY = YES; 383 | GCC_C_LANGUAGE_STANDARD = gnu99; 384 | GCC_DYNAMIC_NO_PIC = NO; 385 | GCC_OPTIMIZATION_LEVEL = 0; 386 | GCC_PREPROCESSOR_DEFINITIONS = ( 387 | "POD_CONFIGURATION_DEBUG=1", 388 | "DEBUG=1", 389 | "$(inherited)", 390 | ); 391 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 392 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 393 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 394 | GCC_WARN_UNDECLARED_SELECTOR = YES; 395 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 396 | GCC_WARN_UNUSED_FUNCTION = YES; 397 | GCC_WARN_UNUSED_VARIABLE = YES; 398 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 399 | ONLY_ACTIVE_ARCH = YES; 400 | STRIP_INSTALLED_PRODUCT = NO; 401 | SYMROOT = "${SRCROOT}/../build"; 402 | }; 403 | name = Debug; 404 | }; 405 | C39BBDABE20774EE1E835158A2754FB0 /* Debug */ = { 406 | isa = XCBuildConfiguration; 407 | baseConfigurationReference = 6F018EAD469B7A34751A9072A1C883A3 /* Pods-JWDFMDB-Data.debug.xcconfig */; 408 | buildSettings = { 409 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 410 | DEBUG_INFORMATION_FORMAT = dwarf; 411 | ENABLE_STRICT_OBJC_MSGSEND = YES; 412 | GCC_NO_COMMON_BLOCKS = YES; 413 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 414 | MACH_O_TYPE = staticlib; 415 | MTL_ENABLE_DEBUG_INFO = YES; 416 | OTHER_LDFLAGS = ""; 417 | OTHER_LIBTOOLFLAGS = ""; 418 | PODS_ROOT = "$(SRCROOT)"; 419 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 420 | PRODUCT_NAME = "$(TARGET_NAME)"; 421 | SDKROOT = iphoneos; 422 | SKIP_INSTALL = YES; 423 | }; 424 | name = Debug; 425 | }; 426 | C7BA904A87CCDF175A63DBF60D6810A9 /* Release */ = { 427 | isa = XCBuildConfiguration; 428 | baseConfigurationReference = B2AC8D08AB9E95E701EC049C53414AEB /* FMDB.xcconfig */; 429 | buildSettings = { 430 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 431 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 432 | ENABLE_STRICT_OBJC_MSGSEND = YES; 433 | GCC_NO_COMMON_BLOCKS = YES; 434 | GCC_PREFIX_HEADER = "Target Support Files/FMDB/FMDB-prefix.pch"; 435 | IPHONEOS_DEPLOYMENT_TARGET = 4.3; 436 | MTL_ENABLE_DEBUG_INFO = NO; 437 | OTHER_LDFLAGS = ""; 438 | OTHER_LIBTOOLFLAGS = ""; 439 | PRIVATE_HEADERS_FOLDER_PATH = ""; 440 | PRODUCT_NAME = "$(TARGET_NAME)"; 441 | PUBLIC_HEADERS_FOLDER_PATH = ""; 442 | SDKROOT = iphoneos; 443 | SKIP_INSTALL = YES; 444 | }; 445 | name = Release; 446 | }; 447 | C927F16051BDBD9FC4A228894BF579D2 /* Release */ = { 448 | isa = XCBuildConfiguration; 449 | baseConfigurationReference = CD28B22311D0C41D476D0E6664441F99 /* Pods-JWDFMDB-Data.release.xcconfig */; 450 | buildSettings = { 451 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 452 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 453 | ENABLE_STRICT_OBJC_MSGSEND = YES; 454 | GCC_NO_COMMON_BLOCKS = YES; 455 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 456 | MACH_O_TYPE = staticlib; 457 | MTL_ENABLE_DEBUG_INFO = NO; 458 | OTHER_LDFLAGS = ""; 459 | OTHER_LIBTOOLFLAGS = ""; 460 | PODS_ROOT = "$(SRCROOT)"; 461 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SDKROOT = iphoneos; 464 | SKIP_INSTALL = YES; 465 | }; 466 | name = Release; 467 | }; 468 | /* End XCBuildConfiguration section */ 469 | 470 | /* Begin XCConfigurationList section */ 471 | 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { 472 | isa = XCConfigurationList; 473 | buildConfigurations = ( 474 | AE9439C22469D35336242DD983DB5C5F /* Debug */, 475 | 42287DDF97330524BA3EF220F0276DA6 /* Release */, 476 | ); 477 | defaultConfigurationIsVisible = 0; 478 | defaultConfigurationName = Release; 479 | }; 480 | 3AC899FD215914230EB9D8B57AD910D0 /* Build configuration list for PBXNativeTarget "FMDB" */ = { 481 | isa = XCConfigurationList; 482 | buildConfigurations = ( 483 | 0BC8ACAA1BBCD83153EF57E2B89FB594 /* Debug */, 484 | C7BA904A87CCDF175A63DBF60D6810A9 /* Release */, 485 | ); 486 | defaultConfigurationIsVisible = 0; 487 | defaultConfigurationName = Release; 488 | }; 489 | F2CFCD215A396E15EACBD5E4A86DC21C /* Build configuration list for PBXNativeTarget "Pods-JWDFMDB-Data" */ = { 490 | isa = XCConfigurationList; 491 | buildConfigurations = ( 492 | C39BBDABE20774EE1E835158A2754FB0 /* Debug */, 493 | C927F16051BDBD9FC4A228894BF579D2 /* Release */, 494 | ); 495 | defaultConfigurationIsVisible = 0; 496 | defaultConfigurationName = Release; 497 | }; 498 | /* End XCConfigurationList section */ 499 | }; 500 | rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; 501 | } 502 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Pods.xcodeproj/xcuserdata/jiangweidong.xcuserdatad/xcschemes/FMDB.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Pods.xcodeproj/xcuserdata/jiangweidong.xcuserdatad/xcschemes/Pods-JWDFMDB-Data.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Pods.xcodeproj/xcuserdata/jiangweidong.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FMDB.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-JWDFMDB-Data.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1AE22CE23E600844870CA6152F101866 21 | 22 | primary 23 | 24 | 25 | 9F12FB4A63E20F601CFB2E64A65B57C1 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/FMDB/FMDB-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FMDB : NSObject 3 | @end 4 | @implementation PodsDummy_FMDB 5 | @end 6 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/FMDB/FMDB-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/FMDB/FMDB.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FMDB 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FMDB" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FMDB" 4 | OTHER_LDFLAGS = -l"sqlite3" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## FMDB 5 | 6 | If you are using FMDB in your project, I'd love to hear about it. Let Gus know 7 | by sending an email to gus@flyingmeat.com. 8 | 9 | And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you 10 | might consider purchasing a drink of their choosing if FMDB has been useful to 11 | you. 12 | 13 | Finally, and shortly, this is the MIT License. 14 | 15 | Copyright (c) 2008-2014 Flying Meat Inc. 16 | 17 | Permission is hereby granted, free of charge, to any person obtaining a copy 18 | of this software and associated documentation files (the "Software"), to deal 19 | in the Software without restriction, including without limitation the rights 20 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 21 | copies of the Software, and to permit persons to whom the Software is 22 | furnished to do so, subject to the following conditions: 23 | 24 | The above copyright notice and this permission notice shall be included in 25 | all copies or substantial portions of the Software. 26 | 27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 28 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 29 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 30 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 31 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 32 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 33 | THE SOFTWARE. 34 | Generated by CocoaPods - https://cocoapods.org 35 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | If you are using FMDB in your project, I'd love to hear about it. Let Gus know 18 | by sending an email to gus@flyingmeat.com. 19 | 20 | And if you happen to come across either Gus Mueller or Rob Ryan in a bar, you 21 | might consider purchasing a drink of their choosing if FMDB has been useful to 22 | you. 23 | 24 | Finally, and shortly, this is the MIT License. 25 | 26 | Copyright (c) 2008-2014 Flying Meat Inc. 27 | 28 | Permission is hereby granted, free of charge, to any person obtaining a copy 29 | of this software and associated documentation files (the "Software"), to deal 30 | in the Software without restriction, including without limitation the rights 31 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 32 | copies of the Software, and to permit persons to whom the Software is 33 | furnished to do so, subject to the following conditions: 34 | 35 | The above copyright notice and this permission notice shall be included in 36 | all copies or substantial portions of the Software. 37 | 38 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 39 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 40 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 41 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 42 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 43 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 44 | THE SOFTWARE. 45 | Title 46 | FMDB 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | FooterText 52 | Generated by CocoaPods - https://cocoapods.org 53 | Title 54 | 55 | Type 56 | PSGroupSpecifier 57 | 58 | 59 | StringsTable 60 | Acknowledgements 61 | Title 62 | Acknowledgements 63 | 64 | 65 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JWDFMDB_Data : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JWDFMDB_Data 5 | @end 6 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FMDB" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FMDB" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FMDB" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"FMDB" -l"sqlite3" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /JWDFMDB-Data/Pods/Target Support Files/Pods-JWDFMDB-Data/Pods-JWDFMDB-Data.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FMDB" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FMDB" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FMDB" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"FMDB" -l"sqlite3" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JWDFMDB-Data-Message 2 | 3 | 使用FMDB使用数据库存储数据 4 | --------------------------------------------------------------------------------