views:

540

answers:

2

My iPhone application uses SQLITE's FTS3 functions (specifically MATCH and OFFSET). These are essential to my optimized searching algorithm. I implemented FTS3 by including three SQLITE source files, namely sqlite3.c, sqlite3.h and sqlite3ext.h in my project, under a group named SQLite. I removed from the Frameworks group my previous reference to the libsqlite3.dylib library. I set the "Other C Flags" and "Other C++ Flags" project settings to -DSQLITE_ENABLE_FTS3=1. (I also tried simply setting those flags to -DSQLITE_ENABLE_FTS3.)

The application performs perfectly in the Simulator for both debug and release builds. The application also performs perfectly on the iPhone, BUT only for the debug build!

The release build does not return result rows for any SQL calls using the MATCH and OFFSET keywords. My specific question is, "When I build the release version with my iPhone connected, is my FTS3 enabled version of SQLITE not being installing along with my app?" I see the sqlite.o object file in the appropriate Release-iphoneos subfolder on my Mac. It is a bit smaller than the one in the Debug-iphoneos subfolder, but I concluded this is due to a lack of debug symbols.

I am desperate for a solution, so any ideas at all will be greatly appreciated.

A: 

The first thing I would do is make a clean build of the iPhone release build and look in detail at the raw build log. You can look at the actual commands executed there to see if those extra compiler/preprocessor flags are actually configured to be used for that target.

If they are not then you probably made a mistake in the Target settings.

St3fan
Thank you for your reply. I now just realized that my problem has nothing to do with fts3 and sqlite. However, your answer did teach me where the raw log files are and I did a compare on them. I learned alot from that exercise.However, my issue is that cellForRowAtIndexPath is not being called in the Device-Release build - but it is in the Device-Debug build and Simulator-Release build! That is the problem. I am researching and debugging, but not yet successful. Any ideas as to why the behavior is different even though the code is the same?
A: 

OK, for those who may benefit from my quirky experience, here was the solution. After much hair pulling I decided to relax some of the optimization in the Release version. I did this just to get another clue as to the problem - not as a solution. Sure enough, the code worked perfectly! Then, I said "OK, let me put the optimization back to smallest and fastest to continue my investigation." Magically, everything still worked!!! In summary, the only thing that I did was to change the optimization in the the Project settings, and then put it back! All of this, of course, was after a lot of debugging, recompiling after cleaning all targets, etc. NOTHING had made a difference until I changed and reset the optimization to the original value. Crazy, but that is my story and I'm sticking to it. Hope this helps someone else experiencing this problem.