iOS iPhone SQLite和Monotouch问题 [英] iOS iPhone SQLite and Monotouch issue
问题描述
我已经用Monodevelop 2.8成功开发了一个小型iPhone + Monotouch(最新版本)应用程序,它使用SQLite的我编译版来启用FTS4。
要将SQLite编译为静态库(libSQLite.a),我将此主题用作教程:
此外,我也按照本教程创建了一个兼容Simulator + Device的静态库:
使用xcode和sdk-4>构建fat静态库模拟器。 :)
坏消息来自iOS 4的iPhone 4设备。当我在设备上部署并运行应用程序时,它突然崩溃。
要在我的monotouch项目中使用libSQLite.a静态库,我遵循本教程 http://docs.xamarin.com/ios/advanced_topics/linking_native_libraries
运行时似乎出了问题使用以下附加命令编译的设备上的应用程序:
-gcc_flags-L $ {ProjectDir} -lSQLite3 -force_load $ {ProjectDir} /libSQLite3.a
如果我编译和部署应用程序时不需要额外的命令(使用静态链接库)程序就可以在不崩溃的情况下启动。
任何建议?
任何人都已经在iOS的Monotouch应用程序中使用带FTS4的SQLite?
这与我们的错误#707 有关,简而言之,这是一个问题,通常是通过用拇指指令使用外部库引发。这也意味着解决方法很简单:只需在编译静态库时停用Xcode中的拇指支持即可。
作为旁注,我们已经追踪了这个bug,在下一个MonoTouch版本中修复。
I have successfully developed a small iPhone+Monotouch (latest version) application with Monodevelop 2.8, which use a "compiled by me" version of SQLite to enable FTS4.
To compile SQLite as static library (libSQLite.a) I used this topic as tutorial: How to use FTS in SQLite with Monotouch for iOS
Also I've followed this tutorial to create a Simulator+Device compliant static library: Build fat static library (device + simulator) using Xcode and SDK 4+
Things are working great on the simulator. :)
Bad news comes from the device, an iPhone 4 with iOS 4. When I deploy and run the application on the device, it suddenly crashes.
To use the libSQLite.a static library in my monotouch project I've followed this tutorial http://docs.xamarin.com/ios/advanced_topics/linking_native_libraries
It seems that something is going wrong when running the application on the device compiled with this additional command: -gcc_flags "-L${ProjectDir} -lSQLite3 -force_load ${ProjectDir}/libSQLite3.a" If I compile and deploy the application without the additional command (to use the static link library) the program start without crashing.
Any suggestion?
Anybody already use SQLite with FTS4 on a monotouch application for iOS?
This is related to our bug #707, in short it's an issue which is usually provoked by using external libraries with thumb instructions. This also means the workaround is easy: just disable thumb support in Xcode when compiling your static libraries.
As a sidenote we've tracked down the bug and it will hopefully be fixed in the next MonoTouch release.
这篇关于iOS iPhone SQLite和Monotouch问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!