Skip to main content

Posts

Works fine for the first time, next time getting DB locked issue

Please find the below function.it works fine for the first time. I mean , when i add a text it works for the first time , then when i try to add a new text again , it give me like "DB is locked". I am not sure how it works for the first not again? Please let me know what is the problem in my code. //================================================================== - ( BOOL ) addNewSimpleTemplates:(NSString*)dbPath:(NSString*)title{ //================================================================== BOOL returnVal = NO; NSString *maxValuePosition; if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { NSString *selectSQL = [NSString stringWithFormat:@"select MAX(pr.position) FROM phrase_reference pr inner join storyboard_main_categories smc on smc.id = pr.main_category_id where smc.category_name = %@", @"'Simple Templates'"]; const char *sql = [selectSQL UTF8String]; sqlite3_stmt *selectStmt; if(sqlite

Xcode 4.2.1 issue : Universal app runs on iPad but not on iphone

I am right now working on one universal application where I am stuck to one point. I was able to successfully launch my application both on iPhone and iPad but since 2-3 days, I am not able to launch my application on neither iPhone nor iPhone simulator but it runs smoothly on iPad/ipad simulator. Also when I run my app choosing iPhone device it shows message like Running the App on iPhone simulator but i am not able to see any effect on my simulator. I am using Xcode 4.2.1 and I guess the issue is pertains to the same. Kindly help me out to resolve the issue. Thank you.

iPhone: Sqlite update or insert row

I want to update the quantity if the menuid is already available otherwise add a new row. I used the following code.But no row is added or updated. sqlite3 *database; sqlite3_stmt *addStmt=nil; if (selection== nil) { selection =@"Medium"; } if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { const char *select="select quantity from item where menuid = ?"; sqlite3_stmt *selectstmt; if(sqlite3_prepare_v2(database, select, -1, &selectstmt, NULL) == SQLITE_OK) { while(sqlite3_step(selectstmt) == SQLITE_ROW) { menuID= [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 0)]; char *quant = (char *)sqlite3_column_text(selectstmt,1); quantity=[NSString stringWithUTF8String:(char *)quant]; // [self.ids addObject:menuID]; } sqlite3_reset(selectstmt);

Read plist from URL into NSMutableDictionary

I am trying to do read a PLIST from URL to a NSMutableDictionary. Code before autos = [[NSMutableArray alloc] init]; [autos addObject:[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"Auto 1", @"name", @"Auto.png", @"image", @"Klassiker", @"description" , nil]]; This works. But now I want to use a PLIST. And I am trying this, this way: autos = [[NSMutableArray alloc]initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://dl.dropbox.com/u/9358444/auto.plist"]]]; Thanks. PLIST http://dl.dropbox.com/u/9358444/auto.plist

InApp purchase doubts [closed]

I am doing a book reder application in iphone The data is in sqlite,there are five books. There are five UIButtons with button title as book name. For e.g., book1, book2, book3, book4 .... If the user wants to read the above books, he should do a payment in iTunes using InApp Payments. If the payment is correctly done for that particular book, it need the corresponding button to enable for click action, in default it is disabled. Is this possible to do a payment only in inapp and get a payment id. is there any other way for doing the same?