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

  • Home
  • SEARCH
  • 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 210799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:02:16+00:00 2026-05-11T18:02:16+00:00

I’ve been learning to develop applications on the cocoa touch platform. I’ve come a

  • 0

I’ve been learning to develop applications on the cocoa touch platform. I’ve come a long way but one piece that I can’t wrap my head around is memory management.

I thought I’d take a route of comparison rather than trying to start from scratch. I can’t find much on the difference between the CLR (.net) and Objective-C 2.0 so I’m wondering if the stack overflow community can help me with this question.

What are the key/important differences in memory management between Objective-C 2.0 and the CLR? With regard to Objective-C 2.0, I’m developing on the iPhone OS and the autorelease functionality is discouraged.

I guess I’m looking for a comparison of the two… Since I’m coming from a .NET background, what might be things I need to know about Objective-C 2.0 memory management?

Thank you all!

  • 1 1 Answer
  • 1 View
  • 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-11T18:02:16+00:00Added an answer on May 11, 2026 at 6:02 pm

    The CLR runs in a virtual machine; all the deallocation of objects are handled by the garbage collection system. Generally in Objective-C memory must be managed manually via either old C style malloc/free or via the reference counting system of retain/release. If you come from a standard “C” background, the technique won’t seem too foreign.

    With reference counting, the system counts how many times a specific object is used – this is basically the “retain” mentioned above. When something is done using an object the object is manually send a “release” message which decrements the object’s retain count by 1. When the count reaches 0, the system automatically deallocates the object. This will seem extremely cumbersome compared to the CLR/.NET but that mechanism provides better performance and more control.

    If you are coding in Objective-C 2.0 on the Macintosh, you are in luck since garbage collection can be enabled via an option in XCode. This will be closer to what the CLR provides. If you are developing on the iPhone, garbage collection costs too much in terms of memory and CPU so its not an option. Memory must be managed manually.

    Fortunately, there is an in-between option that is commonly used by sending and “autorelease” message to an object. This mechanism, included in both Macintosh and the iPhone, basically pools allocated objects into a global dictionary (its actually called an autorelease pool). Either when the application exists or when the pool is drained, the objects are then de-allocated. However, not everything goes into the autorelease pool nor do you want to put everything there. I recommend the dry but important reading of the Objective-C 2.0 Programming Language from the Apple site that goes into way more detail.

    http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html

    Good luck and have patience. Objective-C isn’t a new kid on the block like .Net (its over 25 years old) but it has some incredible features that .Net is just now starting to incorporate.

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

Sidebar

Ask A Question

Stats

  • Questions 180k
  • Answers 180k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Found the answer, in pathauto settings you can use the… May 12, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer WMIC. See here for more info. There's a tonne of… May 12, 2026 at 4:05 pm
  • Editorial Team
    Editorial Team added an answer I use the following method: ''' <summary> ''' Creates a… May 12, 2026 at 4:05 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS
I am currently running into a problem where an element is coming back from

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.