Note that there are some explanatory texts on larger screens.

plurals
  1. POPosting data from iphone server with help http
    primarykey
    data
    text
    <p>I am trying to post the data from iphone for that use the code like this </p> <pre><code> -(void)sendRequest { NSDate* date = [NSDate date]; //Create the dateformatter object NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease]; //Set the required date format [formatter setDateFormat:@"yyyy-MM-dd HH:MM:SS"]; //Get the string date NSString* str = [formatter stringFromDate:date]; ; ****i am getting the warning 'NSData' may not respond to '- autorelease]; NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; if (theConnection) { webData = [[NSMutableData data] retain]; NSLog(@"%@",webData); } } </code></pre> <p>And it get crash and show the <strong>-[NSConcreteMutableData setLength:]: message sent to deallocated instance 0xdde2760</strong></p> <p>this updata code </p> <pre><code>-(void)sendRequest { NSDate* date = [NSDate date]; //Create the dateformatter object NSDateFormatter* formatter = [[[NSDateFormatter alloc] init] autorelease]; //Set the required date format [formatter setDateFormat:@"yyyy-MM-dd HH:MM:SS"]; //Get the string date NSString* str = [formatter stringFromDate:date]; if (theConnection) { webData = [[NSMutableData data] retain]; NSLog(@"%@",webData); } } -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [webData setLength: 0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [webData appendData:data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [connection release]; [webData release]; } -(void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *loginStatus = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; NSLog(@"%@",loginStatus); [loginStatus release]; [connection release]; [webData release]; } </code></pre>
    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.
 

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