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 404887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:20:58+00:00 2026-05-12T17:20:58+00:00

URL Download http://code.google.com/p/mwiphonesdk/source/browse/#svn/trunk/iMADE/PrepTasks/08 I have code at the location at the link above and

  • 0

URL Download

http://code.google.com/p/mwiphonesdk/source/browse/#svn/trunk/iMADE/PrepTasks/08

I have code at the location at the link above and I am using NSMutableString to append strings as data is downloaded. But I am finding that using appendString does not increase the length of the mutable string. I must be doing something wrong.

And when I am done I need to convert NSMutableString to NSString to return it. I have looked for examples to do this but I do not see any yet.

I am most familiar with Java and C# where there is a StringBuffer/StringBuilder which allows you to append pieces and them simply call toString at the end to get a String. It does not appear to be this easy in Objective-C.

NSString* str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];

#pragma mark TODO Confirm this is appending a value to the mutable string
[self.mutableString appendString:str];

NSLog(@"str length: %d, %d", [str length], [self.mutableString length]);

Above is the section of code that calls appendString.

I see that str has a length > 0 but calling appendString does not increase the length of self.mutableString.

What am I doing wrong here?

  • 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-05-12T17:20:58+00:00Added an answer on May 12, 2026 at 5:20 pm

    As for having an NSMutableString* and needing to return an NSString*, the former is a subclass of the latter so anywhere you see an NSString* an NSMutableString* will suffice as-is.

    Your code looks OK from what you’ve posted. The only thing I can think of is that perhaps there isn’t any data to speak of when initializing the str variable. In such a case appending an empty string will do nothing to mutableString.

    You’ll also want to make sure self.mutableString has been properly allocated and initialized. You can send messages to NSObject*s that are nil which may be misleading when [self.mutableString length] returns 0.

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

Sidebar

Related Questions

http://code.google.com/p/apps-for-android/ I have eclipse setup with Subversive plugin, I can download the codes down
I have this code NSString *tr = [self sendUrl:@http://google.com/]; But for some reason '
I was just trying to convert a PPT using the following URL http://code.google.com/p/qifei/wiki/PDFConverter python
i am using tortoise svn client to download code from code.google.If protocol is http
Right now I am using this code: string url = http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=hey&esrch=FT1; string source =
I am trying to download the image from the url http://a3.twimg.com/profile_images/414797877/05052008321_bigger.jpg I am using
I want to download a .zip file which is available at URL http://www.nseindia.com/content/equities/cmbhav.htm by
I cannot download file using java if the url contains special characters. eg:-http://something.com/something/this+this+this.html http://something.com/something/this%20this%20this.html
I have the following code to download a URL through a proxy: proxy_handler =
public FileResult Download() { var doc = new EO.Pdf.PdfDocument(); EO.Pdf.HtmlToPdf.ConvertUrl(http://www.google.com/, doc); var ms =

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.