NSString *mediaType = info [UIImagePickerControllerMediaType];
if ([mediaType isEqualToString:(NSString *)kUTTypeImage])
{
NSURL * URL = [NSURL URLWithString:[BGMakeURL URLForUploadImage]];
UIImage * image = info[UIImagePickerControllerEditedImage];
if(!image)
{
image= info[UIImagePickerControllerOriginalImage];
}
NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
parameters [@"__VIEWSTATE"]=@"/wEPDwUKMTQxNzIxMTc0MQ9kFgICAw8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YWRkpPnRKFYg9pwczRd4Lr3SFyeNR3bJtDpNqNyMm9qs/4g=";
parameters [@"__EVENTVALIDATION"]=@"/wEWBgLE38oCAofc/4YFAuv/gd4CApahmrIJAuKeq6sMAu3ehcwDnwyRwRhgxmSADdcUMCfAUEl1cW8dliatCxOiAEYU8Jc=";
parameters [@"Image"]=[FSNData withImage:image jpegQuality:.9 fileName:@"fileName"];
FSNConnection *connection =
[FSNConnection withUrl:URL
method:FSNRequestMethodPOST
headers:nil
parameters:parameters
parseBlock:nil
completionBlock:^(FSNConnection * connection){
id whatistheresult=connection.parseResult;
PO(whatistheresult);
[BGLoadingView toast:@"Image Uploaded"];
}
progressBlock:nil];
[connection start];
就我现在而言,这不是同步的。如果我想要它同步呢?