Note that there are some explanatory texts on larger screens.

plurals
  1. PONSMutableData setLength:NSUInteger crashing the app
    primarykey
    data
    text
    <p>Trying to create a connection of a request with an URL. An NSMutableData instance (responseData) also gets called with it. When the connection starts receiving response, the setLength:NSUInteger method gets called up on the NSMutableData Instance. </p> <pre><code>-(void)startDataDownloading { NSURLRequest *_request = [NSURLRequest requestWithURL:self.url]; if (_request) { if (!connecton) { connecton = [NSURLConnection connectionWithRequest:_request delegate:self]; if (connecton) { responseData = [NSMutableData data]; [connecton start]; } } } } - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [responseData setLength:0]; } - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [responseData appendData:data]; } </code></pre> <p>But somehow it causes a crash with a warning on the setLength call. The error states that </p> <p><b>" -[__NSCFDictionary setLength:]: unrecognized selector sent to instance 0x6a8cf70 2012-11-30 18:00:38.948 RSSReader[8997:f803] <em>*</em> Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setLength:]: unrecognized selector sent to instance 0x6a8cf70' " </b></p> <p>Any hint about this would be appreciated.</p> <pre><code>#import &lt;Foundation/Foundation.h&gt; #import "DataParser.h" @protocol DataConnectionDelegate &lt;NSObject&gt; //protocol methods @end @interface UCDataConnection : NSObject &lt;ModelParser&gt; @property (nonatomic, strong) NSURL *url; @property (nonatomic, strong) NSURLConnection *connecton; @property (strong, nonatomic) NSMutableData *responseData; @property (nonatomic, assign) id&lt;DataConnectionDelegate&gt; delegate; -(void)startDataDownloading; - (id)initWithUrl:(NSURL *)_url andDelegate:(id&lt;DataConnectionDelegate&gt;)_delegate; </code></pre> <p>That is a part of the header file.Sorry for late response.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload