I need to create an app linked with a remote database! Is mysql the best solution? Is Sqlite an only-local solution?
I use the following method and I would to know if it is the best way!
NSString *evento = @"1";
NSString *filtro = @"CAC2";
NSString *strURL = [NSString
stringWithFormat:@"http://www.xxxxxxx.com/Scripts/Evento/WIGriceviTipo.php?
evento=%@&filtro=%@",evento, filtro];
NSData *dataURL = [NSData dataWithContentsOfURL:
[NSURL URLWithString:strURL]];
NSString *strResult = [[NSString alloc] initWithData:dataURL
encoding:NSUTF8StringEncoding];
strResult = [strResult stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet]];
mostra.text=strResult;
NSLog(@"%@", strResult);
Why not use
Core Data? I do lots of remote database interaction and use CD for the local storage and just pass all the data to a web-service that digests it, checks for data integrity and then passes along the data to the database.Core Datais a much easier learning curve than you might think and if you use a third party library like Magical Record, it is even easier.As far as the web server database goes, MySQL is the best option (IMO) if you are using a Linux based platform, SQL Server becomes an option if you are going the Windows Server route.