objective c - Getting NSInvalidArgumentException on iOS 9.0, AFNetworking 2.6.0, XCode 7.0.1 -
my app crashes initiate http request via afnetworking. crash consistent , returns following error message:
2015-10-02 14:04:40.845 app name[12130:1274441] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'data parameter nil' *** first throw call stack: ( 0 corefoundation 0x0000000104ddcf65 exceptionpreprocess + 165 1 libobjc.a.dylib 0x00000001046f7deb objc_exception_throw + 48 2 corefoundation 0x0000000104ddce9d +[nsexception raise:format:] + 205 3 foundation 0x00000001028a429d +[nsjsonserialization jsonobjectwithdata:options:error:] + 67 4 app name 0x0000000101231c28 __28-[logincontroller authuser:]_block_invoke + 328 5 app name 0x0000000101226431 __20+[user login:block:]_block_invoke215 + 113 6 ap name 0x00000001012e697b __64-[afhttprequestoperation setcompletionblockwithsuccess:failure:]_block_invoke_3 + 91 7 libdispatch.dylib 0x0000000105575ef9 _dispatch_call_block_and_release + 12 8 libdispatch.dylib 0x000000010559649b _dispatch_client_callout + 8 9 libdispatch.dylib 0x000000010557e34b _dispatch_main_queue_callback_4cf + 1738 10 corefoundation 0x0000000104d3d3e9 __cfrunloop_is_servicing_the_main_dispatch_queue + 9 11 corefoundation 0x0000000104cfe939 __cfrunlooprun + 2073 12 corefoundation 0x0000000104cfde98 cfrunlooprunspecific + 488 13 graphicsservices 0x0000000107d38ad2 gseventrunmodal + 161 14 uikit 0x000000010327b676 uiapplicationmain + 171 15 app name 0x000000010122d04f main + 111 16 libdyld.dylib 0x00000001055ca92d start + 1) libc++abi.dylib: terminating uncaught exception of type nsexception
any ideas? here's code responsible request:
afhttprequestoperationmanager *manager = [[afhttprequestoperationmanager manager] initwithbaseurl:[apiclient base_url]]; nsmutabledictionary *parameters = [nsmutabledictionary dictionary]; [parameters setobject:@"password" forkey:@"user[password]"]; [parameters setobject:@"username" forkey:@"user[username]"]; [manager post:@"/users/sign_in.json" parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { if (block) { // handle response } } failure:^(afhttprequestoperation *operation, nserror *error) { block(nil, error, operation); }];
the title of question specifies: "ios 8.0, afnetworking 2.6.0, xcode 7.0.1". i'm going guess that's false, , in fact ios 9. networking has changed in ios 9; http://
requests in ios 9 illegal unless permit them in info.plist.
Comments
Post a Comment