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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:00:39+00:00 2026-06-16T04:00:39+00:00

I have seen many samples of NSXMLParser and understand how it works. For example,

  • 0

I have seen many samples of NSXMLParser and understand how it works. For example, this one is very good:

http://wiki.cs.unh.edu/wiki/index.php/Parsing_XML_data_with_NSXMLParser

All samples I saw use Release to release temporary objects at some point during parsing which is OK. But if I switch on ARC, I don’t have access to release at all. How does the sample code change then?

For example, please look at the above code (link) and explain how would you change it with ARC ON?

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-16T04:00:40+00:00Added an answer on June 16, 2026 at 4:00 am

    For a discussion of how one goes about making non-ARC code enabled with ARC, I’d refer you to the Transitioning to ARC Release Notes. As Midhun alludes, you will be replacing retain references with strong references and eliminating release and autorelease. You’ll also be removing calls to [super dealloc]. So the conversion isn’t hard, but there are a number of items to be conscious of.

    Having said that, I disagree with your assessment that this example code is “pretty good.” With no insult to the original author, it’s a little outdated, and as such, is applying historical conventions rather than the modern contemporary practice (e.g. explicitly declared ivars for properties, not using underscore for ivar names, etc.). I also noticed a few bugs in the code (minor things like a missing property, more significant things like a bug in the foundCharacters routine, etc.).

    I’ve cleaned up the code (both converting it to ARC and addressing a number of these issues) and have uploaded it to a repository on GitHub. Note, I’ve done two things:

    1. I’ve modified the code to be a little more contemporary in its practices (this is the UsersParser class) and fixing a few of these little bugs;

    2. I’ve also made a rendition of this code which is a little more flexible, the XmlArrayParser, where the parser class isn’t hard-coded for the Users XML file that the example uses. The method that calls this has to understand what elements we’re looking for, but the parser itself doesn’t care.

    I hope this help.

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

Sidebar

Related Questions

I have seen many samples of Ruby code with this line (for example, http://www.sinatrarb.com/
I have seen this statement in many of the documention samples, like here This
This one will be interesting... I have seen many asp.net thumbnail generation tutorials /
I have seen many posting this issue in SO. I have gone through those
I have seen many answers for this type of question but its not related
I have seen many articles about POCO. What is this?
I have seen many samples to hard code the number of texture unit in
I have seen many samples how to upload and download files using the brecham.obex
I've seen many questions regarding this topic, yet I cannot find one satisfactory answer.
I have seen many code samples for loading textures for OpenGL , many of

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.