tag:blogger.com,1999:blog-203063759820106893.post8324536818956889031..comments2023-03-25T08:30:26.602-04:00Comments on A Moment of Zen: Introducing MonoTouch.SQLiteJeffrey Stedfasthttp://www.blogger.com/profile/12271561115384429651noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-203063759820106893.post-89416665191837245622013-08-12T09:28:51.138-04:002013-08-12T09:28:51.138-04:00Awesome controller! It make using sqlite so easy,...Awesome controller! It make using sqlite so easy, especially for large datasets. However, I'm running into a crash issue (SIGSEGV) the second time I open my SQLIteTableViewController:<br />mono-rt: Stacktrace:<br /><br /><br />mono-rt: at <0xffffffff><br /><br />mono-rt: at (wrapper managed-to-native) MonoTouch.Foundation.NSObject.monotouch_release_managed_ref (intptr) <br /><br />mono-rt: at MonoTouch.Foundation.NSObject.ReleaseManagedRef () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/Foundation/NSObject.cs:98<br /><br />mono-rt: at MonoTouch.Foundation.NSObject/NSObject_Disposer.Drain (MonoTouch.Foundation.NSObject) [0x00062] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSObject2.cs:545<br /><br />mono-rt: at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) <br /><br />mono-rt: at <0xffffffff><br /><br />mono-rt: at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <br /><br />mono-rt: at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38<br /><br />mono-rt: at RSO.MT.Application.Main (string[]) [0x00000] in /Users/TechMac6/Projects/Sales/RSOTouch/Main.cs:17<br /><br />mono-rt: at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr) <br /><br />mono-rt: <br />Native stacktrace:<br /><br /><br />mono-rt: <br />=================================================================<br />Got a SIGSEGV while executing native code. This usually indicates<br />a fatal error in the mono runtime or one of the native libraries <br />used by your application.<br />=================================================================<br />I was able to reproduce the crash in your sample by pushing a UITableViewController first with a single UIButton that pushes an instance of the SQLiteTableViewController. press the back button and try loading the SQLIteTableViewContrller again and sqlite aborts. It seems to be a memory issue. Any ideas?<br />JeffScancohttps://www.blogger.com/profile/09731555300264876979noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-12624735107673719412012-10-08T11:31:02.813-04:002012-10-08T11:31:02.813-04:00Hi Hugo,
I haven't had the MT error, so I don...Hi Hugo,<br /><br />I haven't had the MT error, so I don't know. It looks like that is just a warning in the latest MonoTouch 6.0.3+ releases.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-36920116388743190202012-10-08T10:56:58.224-04:002012-10-08T10:56:58.224-04:00Is this code affected by the MT4112 problem?
&quo...Is this code affected by the MT4112 problem?<br /><br />"Note that generic subclasses of exported types is not a supported scenario, and<br />may fail/crash randomly.". I get those crashed. MT 6.0.2 gave an error about this. I fixed it, but it still seems to be unsupported...<br /><br />The problem is the SQLiteTableViewController class, because it is a generic subclass of UITableViewController...Anonymoushttps://www.blogger.com/profile/16709093949346083840noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-77145936381684041592012-10-04T17:04:48.594-04:002012-10-04T17:04:48.594-04:00Thanks Jeff. Imho option 2 was the best, and I imp...Thanks Jeff. Imho option 2 was the best, and I implemented that just by adding a "fixedWhereClause" property (string). This is non-intrusive because it is fully optional to use it. Next I will add the possibility to set a table name overriding the detection. This way any sqlite-view can be used. Combined with the where-clause even complex queries can be performed using your flexible code. Want me to provide the code?Anonymoushttps://www.blogger.com/profile/04648298077035173799noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-71157818645284353422012-10-04T08:36:59.760-04:002012-10-04T08:36:59.760-04:00Hi Hugo,
You have a couple of options:
1. You co...Hi Hugo,<br /><br />You have a couple of options:<br /><br />1. You could use the search API that sets the where-clause directly instead of using the SearchText property. You would have to do your own parsing of the search text, but that might not be hard, depending on your needs.<br /><br />2. You could override (or just modify the original SQLiteTableModel code directly, since it's open source) SQLiteTableModel to generate your own commands with a fixed where-clause in there.<br /><br />3. You could cheat by taking the user-entered text and append or prepend: "parent:id" where "id" is replaced with whatever parent id you need. This is the equivalent of tacking on an 'and' expression to the overall 'where' expression.<br /><br />Hope that helps.Jeffrey Stedfasthttps://www.blogger.com/profile/12271561115384429651noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-72407297956350245082012-10-04T06:33:42.575-04:002012-10-04T06:33:42.575-04:00Nice work, could implement this quite easily. But ...Nice work, could implement this quite easily. But now I need to add a fixed where-clause (get all items with a certain parent_id) I don't understand where to start...Anonymoushttps://www.blogger.com/profile/16709093949346083840noreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-39233901436654339882012-03-26T06:33:35.264-04:002012-03-26T06:33:35.264-04:00Wow, this is pretty amazing stuff. When I was tryi...Wow, this is pretty amazing stuff. When I was trying to write the news report for InfoQ I kept getting distracted by thinking of ways I can use your ideas in my Silverlight application.<br /><br />Jonathan Allen<br />jonathan@infoq.comJonathan Allenhttp://www.infoq.comnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-26269090931212833822012-03-23T11:10:25.509-04:002012-03-23T11:10:25.509-04:00Excellent info. Love it when things work out. I...Excellent info. Love it when things work out. I'll definitely share this with one of our developers who is a big SQLite fan. <br /><br />http://blog.inspiringapps.com/sqlite-database-engine/Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-203063759820106893.post-78723965172394884552012-03-18T01:12:32.115-04:002012-03-18T01:12:32.115-04:00hi, thanks your so good demo.
but how can i add U...hi, thanks your so good demo.<br /><br />but how can i add UINavigationBar in your demo?Anonymousnoreply@blogger.com