Re: Why doesn't this work on my device?

2009-02-27 Thread Clark Cox
On Fri, Feb 27, 2009 at 10:44 AM, Stuart Malin wrote: > > > On Feb 27, 2009, at 8:27 AM, James Cicenia wrote: > >> ARrrgh... >> >> The database exists but it contains nothing?! I double checked it in >> my trusty firefox sqlite extension, and everything is there. >> Is there some magic "touch" I

Re: Why doesn't this work on my device?

2009-02-27 Thread Stuart Malin
On Feb 27, 2009, at 8:27 AM, James Cicenia wrote: ARrrgh... The database exists but it contains nothing?! I double checked it in my trusty firefox sqlite extension, and everything is there. Is there some magic "touch" I need to do to get the tables properly into the device? I have cleaned my

Re: Why doesn't this work on my device?

2009-02-27 Thread James Cicenia
YES YES YES Maybe with all my... yes, I admit, start throwing stuff, deleting, recoding, I must have done that. Then I just "assumed" that it would it push a fresh copy over. Wow, that was a frustrating bug. Again,,, thank you, thank you, thank you. I owe you a beer, or whatever. App

Re: Why doesn't this work on my device?

2009-02-27 Thread Bill Bumgarner
On Feb 27, 2009, at 9:07 AM, James Cicenia wrote: ARrrgh... The database exists but it contains nothing?! I double checked it in my trusty firefox sqlite extension, and everything is there. Is there some magic "touch" I need to do to get the tables properly into the device? I have cleaned my

Re: Why doesn't this work on my device?

2009-02-27 Thread James Cicenia
ARrrgh... The database exists but it contains nothing?! I double checked it in my trusty firefox sqlite extension, and everything is there. Is there some magic "touch" I need to do to get the tables properly into the device? I have cleaned my project, restarted xcode, rebuilt, etc. thanks

Re: Why doesn't this work on my device?

2009-02-27 Thread Bill Bumgarner
On Feb 27, 2009, at 8:44 AM, James Cicenia wrote: Don't use UTF8String to get a C string for a file system path, you should use -fileSystemRepresentation. I don't even know what that is? It is documented-- google, Xcode's documentation window, or developer.apple.com will quickly fulfill yo

Re: Why doesn't this work on my device?

2009-02-27 Thread James Cicenia
Thanks for your patience. I did in fact use portions of sqlite books and have the following code: // Creates a writable copy of the bundled default database in the application Documents directory. - (void)createEditableCopyOfDatabaseIfNeeded { // First, test for existence. BOOL succe

Re: Why doesn't this work on my device?

2009-02-27 Thread Bill Bumgarner
On Feb 27, 2009, at 7:56 AM, James Cicenia wrote: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"whatsfr

Re: Why doesn't this work on my device?

2009-02-27 Thread James Cicenia
It is a new morning. Same problem. Here is my code: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"wha

Re: Why doesn't this work on my device?

2009-02-26 Thread Bill Bumgarner
On Feb 26, 2009, at 8:50 PM, James Cicenia wrote: That is helping immensely. I have isolated it to the sqlite area. I can't believe I didn't know you could debug on the device itself.. THANKS! Though it works very bizarrely ... seems to step backwards sometimes?! That'll most likely be becau

Re: Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
d'oh That is helping immensely. I have isolated it to the sqlite area. I can't believe I didn't know you could debug on the device itself.. THANKS! Though it works very bizarrely ... seems to step backwards sometimes?! Anyway, onto reading more about sqlite in the device itself. It doesn't

Re: Why doesn't this work on my device?

2009-02-26 Thread Michael Ash
On Thu, Feb 26, 2009 at 6:29 PM, James Cicenia wrote: > hmmm... > > Well I am WebObjects guy, so, I know java pretty darn well and it is fast on > the server. > I love developing for the iphone. And I find objective-c to be really nice > with this one > major hole in my knowledge. > > Anyway, I do

Re: Why doesn't this work on my device?

2009-02-26 Thread Shawn Erickson
On Thu, Feb 26, 2009 at 4:43 PM, James Cicenia wrote: > OK - > > Let me bother you one time more. > > I have found, the offending code, based upon log files etc. > >        currentStates = [[NSMutableArray alloc] init]; >        self.currentStates = [self statesWithinMiles:currentMiles]; The abov

Re: Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
OK - Let me bother you one time more. I have found, the offending code, based upon log files etc. currentStates = [[NSMutableArray alloc] init]; self.currentStates = [self statesWithinMiles:currentMiles]; currentStates is not holding up in the device. It is somehow or somewhe

Re: Why doesn't this work on my device?

2009-02-26 Thread Greg Parker
On Feb 26, 2009, at 1:37 PM, James Cicenia wrote: Here is the code. It works on the simulator: -(NSMutableArray *)statesWithinMiles:(NSString *)miles{ NSMutableArray *states = [[NSMutableArray alloc]init]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, N

Re: Why doesn't this work on my device?

2009-02-26 Thread Bill Bumgarner
On Feb 26, 2009, at 3:29 PM, James Cicenia wrote: hmmm... Well I am WebObjects guy, so, I know java pretty darn well and it is fast on the server. I love developing for the iphone. And I find objective-c to be really nice with this one major hole in my knowledge. Anyway, I do load somethin

Re: Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
hmmm... Well I am WebObjects guy, so, I know java pretty darn well and it is fast on the server. I love developing for the iphone. And I find objective-c to be really nice with this one major hole in my knowledge. Anyway, I do load something from a preferences file. So how do I debug that

Re: Why doesn't this work on my device?

2009-02-26 Thread Bill Bumgarner
On Feb 26, 2009, at 3:23 PM, James Cicenia wrote: I understand. I read the docs on memory management. Thought I understood it, fixed my code, etc. Then I pushed it to the phone. Maybe I need to sleep on this. Though it would have been nice if the simulator really was a simulator. I was so

Re: Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
I understand. I read the docs on memory management. Thought I understood it, fixed my code, etc. Then I pushed it to the phone. Maybe I need to sleep on this. Though it would have been nice if the simulator really was a simulator. I was so close, so excited, etc. and then bam! It doesn't wo

Re: Why doesn't this work on my device?

2009-02-26 Thread Bill Bumgarner
On Feb 26, 2009, at 2:58 PM, James Cicenia wrote: I have used both retain and without: - (void)applicationDidFinishLaunching:(UIApplication *)application { statesArray = [[[NSMutableArray alloc] init]retain]; OK -- you need to step back and think this stuff through. In particular,

Re: Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
I have used both retain and without: - (void)applicationDidFinishLaunching:(UIApplication *)application { statesArray = [[[NSMutableArray alloc] init]retain]; On Feb 26, 2009, at 4:56 PM, Bill Bumgarner wrote: On Feb 26, 2009, at 2:53 PM, James Cicenia wrote: @property (nonatomic,

Re: Why doesn't this work on my device?

2009-02-26 Thread Bill Bumgarner
On Feb 26, 2009, at 2:53 PM, James Cicenia wrote: @property (nonatomic, copy) NSMutableArray *statesArray; Where are you allocating statesArray? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
First off thank you for answering Well unfortunately,,, this problem is more than in this bit of code. Here is a snippet where the statesArray never gets filled. It works great in the simulator. I think I am missing some key retain or such.. statesArray is synthesized and properly setup

Re: Why doesn't this work on my device?

2009-02-26 Thread Jason Foreman
On Thu, Feb 26, 2009 at 3:37 PM, James Cicenia wrote: > Why doesn't this work on the device? > Help this is causing me hours of grief with errors like these. What errors? You haven't shown any, just code. Define "doesn't work" and you'll get better help. >if (sqlite3_open([path UTF8String]

Why doesn't this work on my device?

2009-02-26 Thread James Cicenia
Here is the code. It works on the simulator: -(NSMutableArray *)statesWithinMiles:(NSString *)miles{ NSMutableArray *states = [[NSMutableArray alloc]init]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDi