前几天写了一下NSURLSession下载,今天就写一个上传吧
#import "ViewController.h"
#import "AFNetworking.h"
@interface ViewController ()<UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate>
@property(nonatomic,strong) UIImageView * imageView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 200, 200)];
[self.view addSubview:_imageView];
UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(150, 350, 80, 30);
[self.view addSubview:btn];