ios - AFNetworking and -[__NSCFBoolean length]: unrecognized selector sent to instance 0x1f54358 -
i have days strange problem 2014-03-24 16:50:56.097 myapp[1610:4703] -[__nscfboolean length]: unrecognized selector sent instance 0x1f54358
.
i have debugging library, static library package .framework , distribute developers.
debugging little hard, in point of breakpoints, have added static library .xcodeproj file sample client application , tried work it. after research , trying figure out occur have no other reason believe it's afnetworking problem!
i have code in static library:
edited:
// selector parameter (nsdata *)thedata nsmutableurlrequest *arequest = [[[nsmutableurlrequest alloc] initwithurl:theurl cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:10.0f] autorelease]; [arequest sethttpmethod:@"post"]; [arequest setvalue:key forhttpheaderfield:@"custom-header"]; [arequest setvalue:@"plain/text" forhttpheaderfield:@"content-type"]; nsmutabledata *postdata = [nsmutabledata data]; [postdata appenddata:thedata]; [arequest sethttpbody:postdata]; afhttprequestoperation* operation = [[afhttprequestoperation alloc] initwithrequest:arequest]; [operation setcompletionblockwithsuccess:^(afhttprequestoperation *operation, id responseobject) { _pendingdispatchescount --; nslog(@"%@, %ld", kserverrespondedmsg, (long)operation.response.statuscode); bool statuscodeacceptable = [[nsindexset indexsetwithindexesinrange:nsmakerange(200, 100)] containsindex:[operation.response statuscode]]; dispatch_async(dispatch_get_main_queue(), ^{ [delegate analyticsoperationcompleted:statuscodeacceptable fordata:analyticsdata]; }); } failure:^(afhttprequestoperation *operation, nserror *error) { _pendingdispatchescount --; nslog(@"%@, %ld", kserverrespondedmsg, (long)operation.response.statuscode); dispatch_async(dispatch_get_main_queue(), ^{ [delegate analyticsoperationcompleted:no fordata:analyticsdata]; }); }]; [operation start];
if comment [operation start];
sample client starts properly. if let operation start 2014-03-24 16:50:56.097 myapp[1610:4703] -[__nscfboolean length]: unrecognized selector sent instance
.
drives me crazy @ moment, because error occurs 1 developer reported , created sample reproduces it.
edit: found way stacktrace , seems not caused application:
backtrace:
0 corefoundation 0x000000010201c495 __exceptionpreprocess + 165 1 libobjc.a.dylib 0x0000000101d7b99e objc_exception_throw + 43 2 corefoundation 0x00000001020ad65d -[nsobject(nsobject) doesnotrecognizeselector:] + 205 3 corefoundation 0x000000010200dd8d ___forwarding___ + 973 4 corefoundation 0x000000010200d938 _cf_forwarding_prep_0 + 120 5 corefoundation 0x000000010200e9d1 cfurlcreatestringbyaddingpercentescapes + 81 6 cfnetwork 0x0000000103fdf1ab _zl13appendescapedp10__cfstringpks_ + 40 7 cfnetwork 0x0000000103fdef69 _zl25initializeuseragentstringv + 124 8 libsystem_pthread.dylib 0x00000001026d58d6 __pthread_once_handler + 65 9 libsystem_platform.dylib 0x00000001025e3156 _os_once + 73 10 libsystem_pthread.dylib 0x00000001026d5875 pthread_once + 57 11 cfnetwork 0x0000000103fdeb23 cleanuprequest + 105 12 cfnetwork 0x0000000103fde824 _zn17httpnetconnection19preparetransmissionep17httpnetstreaminfop17__corewritestream + 1224 13 cfnetwork 0x0000000103fdda65 _zn13netconnection7enqueueepvh + 539 14 cfnetwork 0x0000000103fdd7e4 _zn17httpnetstreaminfo16_streamimpl_openep13cfstreamerrorph + 88 15 cfnetwork 0x000000010403c295 _zthn120_n17httpnetstreaminfo16_streamimpl_openep13cfstreamerrorph + 13 16 cfnetwork 0x0000000103fbdfc2 _zn14corestreambase21_streaminterface_openev + 80 17 cfnetwork 0x0000000103fdd057 _zn12httpprotocol10openstreamev + 255 18 cfnetwork 0x0000000104048c41 _zn12httpprotocol26usenetconnectionforrequestep13netconnectionp15__cfhttpmessageh + 1753 19 cfnetwork 0x0000000103fdc268 _zn24httpconnectioncacheentry28dispatchconnectiontoprotocolep13netconnectionp12httpprotocolp18httprequestmessageh + 276 20 cfnetwork 0x0000000103fdc027 _zn24httpconnectioncacheentry34notifynextprotocolofopenconnectionep13netconnectionh + 301 21 cfnetwork 0x0000000103fd9230 _zn24httpconnectioncacheentry25enqueuerequestforprotocolep12httpprotocolp15__cfhttpmessage + 650 22 cfnetwork 0x0000000103fd8bf0 _zn19httpconnectioncache34_onqueue_enqueuerequestforprotocolep12httpprotocolp15__cfhttpmessage + 178 23 cfnetwork 0x000000010404e843 ___zn19httpconnectioncache25enqueuerequestforprotocolep12httpprotocolp15__cfhttpmessage_block_invoke + 26 24 corefoundation 0x0000000101fc2f74 cfarrayapplyfunction + 68 25 cfnetwork 0x0000000103fd43e7 _zn19runloopblockcontext7performev + 133 26 cfnetwork 0x0000000103fd4217 _zn17multiplexersource7performev + 247 27 cfnetwork 0x0000000103fd403a _zn17multiplexersource8_performepv + 72 28 corefoundation 0x0000000101fabd21 __cfrunloop_is_calling_out_to_a_source0_perform_function__ + 17 29 corefoundation 0x0000000101fab5f2 __cfrunloopdosources0 + 242 30 corefoundation 0x0000000101fc746f __cfrunlooprun + 767 31 corefoundation 0x0000000101fc6d83 cfrunlooprunspecific + 467 32 foundation 0x000000010193089c +[nsurlconnection(loader) _resourceloadloop:] + 348 33 foundation 0x00000001019832df __nsthread__main__ + 1167 34 libsystem_pthread.dylib 0x00000001026d4899 _pthread_body + 138 35 libsystem_pthread.dylib 0x00000001026d472a _pthread_struct_init + 0 36 libsystem_pthread.dylib 0x00000001026d8fc9 thread_start + 13
edited: link full plcrashreporter crash report symbolicated. https://drive.google.com/file/d/0b_4ydwjioti1c0hia25nsxftwvk/edit?usp=sharing
any or thought appreciated, in advance.
regards.
look @ stack trace , think might go on. stack trace not magical thing, it's directly related code.
the crash caused sending "length" message nsnumber
containing boolean
value.
on stack trace see cfurlcreatestringbyaddingpercentescapes
. seems cfurlcreatestringbyaddingpercentescapes
called nsnumber
object instead of string.
why cfurlcreatestringbyaddingpercentescapes
called? it's called strings containing urls , similar things cannot transmitted , need translating, space %20.
so passed nsnumber
sent on network. header property, url
, , on.
go through things set in url
request. problem in "arequest", since decided hide it. (that's subconscious mind not wanting see mistake of course counter-productive here).
Comments
Post a Comment