我正在尝试将我的付款成功消息上传到我的服务器.以下是我的代码
AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] init];
[manager.requestSerializer setValue:[NSString stringWithFormat:@"Bearer %@",myTokenString] forHTTPHeaderField: @"Authorization"];
AFHTTPRequestOperation *operation = [manager POST:@"MYAPI" parameters:paramsDict success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"%@",responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"%@",error.localizedDescription);
}];
[operation start];
Run Code Online (Sandbox Code Playgroud)
但我收到错误代码500(内部服务器错误).但我的服务器拥有所有信息和API调用是成功的.谁能帮助我理解为什么它会进入错误块?
下面是我访问照片库的代码
-(void)click_gallery
{
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{
UIImagePickerController *imgPicker= [[UIImagePickerController alloc] init];
UIColor* color = [UIColor colorWithRed:46.0/255 green:127.0/255 blue:244.0/255 alpha:1];
[imgPicker.navigationBar setTintColor:color];
imgPicker.delegate = self;
imgPicker.allowsEditing = YES;
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:imgPicker animated:NO completion:Nil];
}
}
Run Code Online (Sandbox Code Playgroud)
并且它与中止
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据.应用程序的Info.plist必须包含一个NSCameraUsageDescription键,其中包含一个字符串值,向用户解释应用程序如何使用此数据.
libsystem_kernel.dylib`__pthread_kill:
0x109955efc <+0>: movl $0x2000148, %eax ; imm = 0x2000148
0x109955f01 <+5>: movq %rcx, %r10
0x109955f04 <+8>: syscall
-> 0x109955f06 <+10>: jae 0x109955f10 ; <+20>
0x109955f08 <+12>: movq %rax, %rdi
0x109955f0b <+15>: jmp 0x1099507cd ; cerror_nocancel
0x109955f10 <+20>: retq
0x109955f11 <+21>: nop …Run Code Online (Sandbox Code Playgroud)