I want to move a subview of my view without deactivating Auto layout, which is useful in other parts of my app.
I was using this code in iOS 7 which was working fine, but is now broken with iOS 8:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
self.avatar = [info objectForKey:UIImagePickerControllerOriginalImage];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSString* request = @"/users/";
[manager
POST:request parameters: nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData
appendPartWithFileData: UIImageJPEGRepresentation(self.avatar, 1.0)
name: @"picture"
fileName: @"new_avatar.jpg"
mimeType: @"image/jpeg"
];
} success:^(AFHTTPRequestOperation *operation, id responseObject) {
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Could not send picture %@ !", error);
}];
I don't understand what is going on, UIImageJPEGRepresentation(self.avatar, 1.0)
contains the image, and as I said, everything was working fine with iOS7.
No request is even made to the server...