Search Results

Search found 7 results on 1 pages for 'amarpreet'.

Page 1/1 | 1 

  • Warning: passing Argument 1 of "sqlite3_bind_text" from incompatible pointer type" What should I do

    - by Amarpreet
    Hi All, i am pretty new in iphone development. I have created one function to insert data into database. The code compiles successfully. But when comes to statement sqlite3_bind_text(sqlStatement, 1, [s UTF8String], -1, SQLITE_TRANSIENT); it does not do anything but hangs AND in warning it says "passing Argument 1 of "sqlite3_bind_text" from incompatible pointer type"" for all statements in Red colour The same code i am using to fetch the data from database and its working on other viewController. Below in the code. Its pretty straightforward. Please help guys. -(void) SaveData: (NSString *)FirstName: (NSString *)LastName: (NSString *)State: (NSString *)Street: (NSString *)PostCode { databaseName = @"Zen.sqlite"; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDire ctory, NSUserDomainMask,YES); NSString *documentsDir=[documentPaths objectAtIndex:0]; databasePath=[documentsDir stringByAppendingPathComponent:databaseName]; sqlite3 *database; if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { const char *sqlStatement = "insert into customers (FirstName, LastName, State, Street, PostCode) values(?, ?, ?, ?, ?)"; sqlite3_stmt *compiledStatement; sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL); sqlite3_bind_text(sqlStatement, 1, [FirstName UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(sqlStatement,2,[LastName UTF8String],-1,SQLITE_TRANSIENT); sqlite3_bind_text(sqlStatement,3,[State UTF8String],-1,SQLITE_TRANSIENT); sqlite3_bind_text(sqlStatement,4,[Street UTF8String],-1,SQLITE_TRANSIENT); sqlite3_bind_text(sqlStatement,5,[PostCode UTF8String],-1,SQLITE_TRANSIENT); sqlite3_step(sqlStatement); sqlite3_finalize(compiledStatement); } sqlite3_close(database); }

    Read the article

  • Database Error : Compiling app on iphone device

    - by Amarpreet
    Hi guys I am getting a problem when i compile my iphone database application to device. When i debug the code it says database path "out of scope" on the break point and it does not compile the statement. Below is the code i am using to access the database. databaseName = @"Zen.sqlite"; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES); NSString *documentsDir=[documentPaths objectAtIndex:0]; databasePath=[documentsDir stringByAppendingPathComponent:databaseName]; It works perfectly fine when i use the same code on simulator. Please help me to get this work on iphone device as well. Thanks.

    Read the article

  • Loading UITableView form UIView

    - by Amarpreet
    Hi Guys, I am working on navigation based application in which i can navigate to many views starting from default UITableView which is starting view in application template. I have added another UIView and added tableView control on that UIView. I am calling that view form one of the many views on a button click. Its showing the view but not populating the data in the table. And I also want to handle the event when user taps on the cell of the table of that view. Below is the Code I am using on button click: if(self.lstView == nil) { ListViewController *viewController = [[ListViewController alloc] initWithNibName:@"ListViewController" bundle:nil]; self.lstView = viewController; [viewController release]; } [self.navigationController pushViewController:lstView animated:YES]; self.lstView.title = @"Select";//@"System"; [self.lstView.tblList.dataSource fillList]; Below is the fillList function code: -(NSArray *)fillList { NSArray *tempArray = [[[NSArray alloc] initWithObjects:@"Item 1" , @"Item 2" , nil]autorelease]; return tempArray; } I am pretty new in Iphone programming and don't have much understanding. Helping with detailed description and code will be highly appreciated. Thanks.

    Read the article

  • Problem in getting response from webserver

    - by Amarpreet
    Hi guys I am sending data to webserver in the Querystrings by creating URL dynamically. When I view that URl in UIAlertView it shows me correct one. And when i try to get response using NSURL code, it does not respond. Below is the code. NSString *uu = @"http://www.zenhomeenergy.com/ZenIphoneServUpdate.aspx?CustomerID=12&FirstName=Andrew&LastName=Turner&State=SA&Street=60 Highfiled Drive Hillbank no phone number&PostCode=5112&Email= &Mobile= &HomePhone= &WorkPhone= &PrimaryResidence=True&HomeOwner=True"; NSString *text = [NSString stringWithContentsOfURL:[NSURL URLWithString:uu]]; if(text) { if([text isEqualToString:@"Success."]) { textView.text = [textView.text stringByAppendingString:@"Success.\n"]; } else { textView.text = [textView.text stringByAppendingString:@"Failed.\n"]; } } If you try putting the above URL into browser it says "Success." But the code above doesnot work. Please Help.

    Read the article

  • How Can I open another App from my app?

    - by Amarpreet
    Hi I have rediATM app installed on my iphone. rediATM app is free on itunes. I want to open that app from my iphone app. I am not able to find out the way to open it. i am using the following code to open it but it takes me to the website. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/au/app/rediatm-finder/id358936470?mt=8"]]; Please help.

    Read the article

  • Cannot copying tables when compiling on Device

    - by Amarpreet
    Hi guys, I am working on sqlite application with around 10 tables in database. it works fine when i run on simulator. And when i open the sqlite file from Applications folder of simulator it shows me all the tables and data. the problem arises when i run app on device. I downloaded the application from device and i checked the sqlite database files there were no tables in it. please help me solving this problem. thanks.

    Read the article

1