iOS iPhone SQLite and Monotouch issue

谁都会走 提交于 2019-12-11 13:01:30

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/8160726/ios-iphone-sqlite-and-monotouch-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!