iOS的SQLite操作
来源:互联网 发布:圣火明尊翅膀进阶数据 编辑:程序博客网 时间:2024/05/16 05:47
1:把东西复制到bundle之外,iPhone模拟器的沙漏安全和真机存在差别的
Your application bundle is not writable on the iPhone. You MUST copy the file somewhere else, like your documents folder. It works in the simulator because the Mac does not enforce all the sandboxing restrictions the iPhone does.
2:50M一个数据库文件的问题,众说风云啊
Most of these answers are totally wrong. Safari will not allow you to create SQLite databases over 50MB (or expand existing databases beyond that size).
This is a limit imposed by Safari - as other people have noted, SQLite itself supports much larger databases that you can use from native apps. But webapps are limited to 50MB.
It might be useful to note that this is per database - if you really need the extra space, you can create multiple databases, although this would obviously cause a lot of hassle.
3:通过配置,要求程序在suspend后直接退出exit,类似通过删除当前的后台未运行应用
There’s a key that can be specified in your AIR app-descriptor.xml iPhone section to do this, that when set to true will inform the device that it should completely exit the application rather than suspend it (when the user hits the home button to go to another application for instance). The flag is called UIApplicationExitsOnSuspend and requires a Boolean value. The definition for this flag from the Apple docs says:
当以上的key是yes,程序会被结束,并且从内存中移开,而不是move到后台。这个key只有在ios4.0以及后续平台支持。
<
iPhone
>
<
InfoAdditions
>
<![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
<key>UIApplicationExitsOnSuspend</key>
<true/>
]]>
</
InfoAdditions
>
<
requestedDisplayResolution
>high</
requestedDisplayResolution
>
</
iPhone
>
UIApplicationExitsOnSuspend
UIApplicationExitsOnSuspend
(Boolean
- iOS) specifies that the application should be terminated rather than moved to the background when it is quit. Applications linked against iOS SDK 4.0 or later can include this key and set its value to YES
to prevent being automatically opted-in to background execution and application suspension. When the value of this key is YES
, the application is terminated and purged from memory instead of moved to the background. If this key is not present, or is set to NO
, the application moves to the background as usual.
This key is supported in iOS 4.0 and later.
在程序的默认。plist文件中;Application dose not run in background选YES,(实际后台是<key>UIApplicationExitsOnSuspend</key>
<true/>
)这样在 OS 4.0 后的applicationWillTerminate就能存盘了。 ......applicationWillTerminate中进行后续处理。。。。。//完成后续处理的代码,
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:....
//当程序退出,保存数据,如果没有设置以上的key,也需要在applicationDidEnterBackground其中做同样的工作
}
原生态第支持在后他运行,及时不需要进入suspend模式By default no, the apps are automatically suspended after being moved to the background and do not execute any code while suspended. I think you would have to do something natively around it to keep it in the background without going into suspended mode. Check out this link for more info about that:
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html
Also, this is another great link I bookmarked that shows how applications enter different states on iOS that may also be useful:
http://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/CoreApplication/CoreApplication.html#//apple_ref/doc/uid/TP40007072-CH3-SW1
- iOS的SQLite操作
- ios sqlite数据库的基本操作
- iOS上数据库SQLite的简单操作
- IOS的SQLITE数据库基本操作
- ios之SQLite操作
- IOS sqlite数据库操作
- IOS sqlite数据库操作
- IOS操作SQLite
- IOS数据库操作(Sqlite)
- IOS操作SQLite
- IOS操作SQLite
- IOS操作SQLite
- IOS-SQLite数据库操作
- ios SQlite操作数据库
- ios sqlite 对象操作
- iOS开发-操作SQLite
- SQLite的介绍 操作Sqlite
- IOS使用sqlite数据库操作
- 如何用W7100A实现串口转以太网
- 8大排序3大查找(二)
- 我的Java思想008:直接父类是Object时,此时构造方法就不需要调用父类的构造方法。
- SAP移动类型详细说明
- JQuery datepicker 使用方法
- iOS的SQLite操作
- 国航OA项目技术总结(一)关于catch的小技巧
- Activity生命周期详解
- 8大排序3大查找(三)
- 进程与线程(八)进程保护(1) && 驱动逆向初步
- 错误./hello: error while loading shared libraries: libQtGui.so.4: cannot open shared object file:
- 使用GDI绘制矩形
- Ubuntu 下面的vim或者的gvim的配置文件
- java实现两个字符串的比较