objective c - iOS Programming with Web database interface -
i programming in obj-c x-code , want create project able pull information database have created in website.
i understand can safely , done mobile web application. ideas how on how parse database objective-c , x-code ?
please reply.
thanks , regards, -venkat
if i'm not mistaken ios sdk can not connect directly database. way send out post request using asihttp class , parse returned data website. read documentation here. example of how use 1 of own applications:
nsurl *url = [nsurl urlwithstring:@"yoursite.com/page.php"]; asiformdatarequest *request = [asiformdatarequest requestwithurl:url]; [request setpostvalue:variable1 forkey:@"key1"]; [request setpostvalue:variable2 forkey:@"key2"]; [request setpostvalue:variable3 forkey:@"key3"]; [request setdelegate:self]; [request startasynchronous];
you catch result following code:
- (void)requestfinished:(asihttprequest *)request { nserror *error = [request error]; if (!error) { nsstring *response = [request responsestring]; //do parsing here } }
don't forget include required files , classes app. it's explained in documentation.
hope helps bit!
Comments
Post a Comment