Thanks to the developer community for their help lol.... Anyway, if anyone is reading this and is interested to know how you can POST an image to a service such as Facebook, this is how I did it:
NSData *imageData = UIImagePNGRepresentation(image_selected);
NSString *facebook_picture_url = [NSString stringWithFormat:@"https://graph.facebook.com/USER_ID/photos?message=%@&access_token=%@", inputted_text, token_facebook];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:facebook_picture_url]];
[request setHTTPMethod:@"POST"];
NSString *boundary = @"---------------------------14737809831466499882746641449";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
[request addValue:contentType forHTTPHeaderField:@"Content-Type"];
NSMutableData *body = [NSMutableData data];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"Content-Disposition: form-data; name=\"userfile\"; filename=\".JPG\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];
[body appendData:[NSData dataWithData:imageData]];
[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:body];
NSHTTPURLResponse *response = nil;
NSError *error = nil;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
NSLog(@"The responce:\n\n%@", responseData);
if (error == nil && response.statusCode == 200) {
NSLog(@"%li", (long)response.statusCode);
}
else {
//Error handling
NSLog(@"%@", response);
}