Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8571517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:47:56+00:00 2026-06-11T18:47:56+00:00

I am doing JSON parsing in my App, When I Use responseData = [NSMutableData

  • 0

I am doing JSON parsing in my App, When I Use responseData = [NSMutableData data]; it crashes on [responseData setLength:0];

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {

   [responseData setLength:0];   // CRASH HERE

}

and when I use responseData=[[NSMutableData alloc]init]; my program works fine. I already make property in .h file

@property (strong, nonatomic) NSMutableData* responseData;

and synthesize in .m file

@synthesize responseData;

Question : what is difference between [NSMutableData data] and [[NSMutableData alloc]init];

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:47:57+00:00Added an answer on June 11, 2026 at 6:47 pm

    [NSMutableData data] returns an autoreleased object whereas [[NSMutableData alloc] init] returns a retained object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i m doing json parsing and i getting response for data like date:1330387200 so
I am doing optimization of web app, where I get list data in JSON
I am doing JSON parsing and I want to show my parsed data in
i am doing jSon parsing in C# (ASP).The problem is that when the JSON
I am doing some json parsing in a bash script: curl http://myurl.com/get.json | sed
Possible Duplicate: Converting XML to JSON using Python? I'm doing some work on App
I am trying to parse the following JSON string remotely: [{name:Object1,data:[1,2]},{name:Object2,data:[3,4]}] I am doing
I was doing Json parsing. As of now, I was reading it from a
i am doing JSON parsing for particular web service with different IDs,Parsing returns some
I'm parsing JSON and getting an array of objects with javascript. I've been doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.