简体   繁体   English

用户在iPhone上为SQLite定义的功能

[英]User defined function for SQLite on iPhone

I'm working on the n'th application locating zip's. 我正在研究第n个应用程序定位zip。 Everything works fine in PHP while I worked along the docu on OpenGeoDB. 当我在OpenGeoDB上编写文档时,PHP中的一切都运行良好。 Now, I'm trying the implementation on the iPhone-SDK, but SQLite doesn't have the ACOS, SIN etc funcs. 现在,我正在尝试在iPhone-SDK上实现,但SQLite没有ACOS,SIN等功能。 Can anybody point me to an example of how to expand the SQLite with userfunctions in order to use them in a select? 任何人都能指出一个如何使用用户函数扩展SQLite以便在select中使用它们的示例吗?

Any hints appreciated! 任何提示赞赏!

Thanx and happy coding! Thanx和快乐的编码! Marcus 马库斯

This one clears it up pretty nicely: 这个很好地清除了它:

http://www.thismuchiknow.co.uk/?p=71 http://www.thismuchiknow.co.uk/?p=71

sqlite3_create_function(database, "yourAwesome", 4, SQLITE_UTF8, NULL, &yourAwesomeFunc, NULL, NULL);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM