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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:59:07+00:00 2026-05-23T09:59:07+00:00

On page 326 in the book Programming in Objective-C 2.0 the author says: myNumber

  • 0

On page 326 in the book Programming in Objective-C 2.0 the author says:

myNumber = [[NSNumber alloc] initWithInt: 1000];  

Of course, based on previous discussions, if you create myNumber this way, you are re- sponsible for subsequently releasing it when you’re done using it with a statement such as follows:

[myNumber release];  

My question is:

Does this mean that if I create an NSNumber object with this statement

NSNumber *myNumber = [NSNumber numberWithInteger: 100];  

I don’t have to release the object myNumber myself?

  • 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-23T09:59:08+00:00Added an answer on May 23, 2026 at 9:59 am

    This link is your bible

    In the case of [NSNumber numberWithInt:] it returns an autoreleased object, and you don’t need to do anything to release it properly. Unless you retain it, of course, in which case you would call release on it, likely from your dealloc method.

    [[NSNumber alloc] initWithInt:] returns an object with a retain count of one (from calling alloc). You are responsible for releasing any object created this way.

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

Sidebar

Related Questions

Page 120 of Programming Pearls 1st edition presents this algorithm for selecting M equally
On page 88 of Stephen Toub's book http://www.microsoft.com/download/en/details.aspx?id=19222 There is the code private BlockingCollection<T>
My page displays an image, and I want to display the previous and next
I am getting a java.lang.VerifyError, on the page of oracle it says it's thrown
Page 215 of the CF9 Web Application Construction Kit volume 1 says Most newer
Wikipedia page for rainbow tables says: this use of multiple reduction functions approximately doubles
Page 146 of the jQuery mobile First look book mentions data-placeholder, but I don't
Page 601 of the C++ Special Edition says... In <ctype.h> and <cctype>, the standard
This page from Adobe says to add a wmode parameter and set its value
On Page 140 of Programming Pearls, 2nd Edition, Jon proposed an implementation of sets

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.