public
Created

iOS example

  • Download Gist
ios.c
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// Async web fetch with JSON parse
 
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"url"]]
queue:nil completionHandler:^(NSURLResponse *r, NSData *d, NSError *e) {
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:d
options:0
error:nil];
}];
 
// Using the camera
- (void)takePicture:(id)sender
{
UIImagePickerController *c = [[UIImagePickerController alloc] init];
[c setDelegate:self];
[self presentViewController:c animated:YES completion:nil];
}
 
- (void)imagePickerController:(UIImagePickerController *)ipc didFinishPickingMediaWithInfo:(NSDictionary *)d
{
UIImage *img = [d objectForKey:UIImagePickerControllerOriginalImage];
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.