• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A bit confused
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A bit confused


  • Subject: Re: A bit confused
  • From: Peter Fischer <email@hidden>
  • Date: Thu, 17 Jun 2004 06:44:03 -0400

On Jun 17, 2004, at 5:52 AM, Michael Curtis wrote:

Hi,

I am sorry about this newbie question, but I am getting a bit
confused. I am making an array and filling it with random numbers.

Are you populating the array with NSNumbers? If you are storing plain integers, you should store
an Integer wrapped in an NSNumber. - [NSNumber numberWithInt:myInt];

I am having trouble return the number out of the array. This is the
error I get.


When you retrieve the numbers from the array, sending an objectAtIndex message to the array
will return your NSNumber, and should give you no problem. Sending an intValue (Or whatever type you are storing) message to the NSNumber should give you your value.

--Pete
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >A bit confused (From: Michael Curtis <email@hidden>)

  • Prev by Date: Re: Releasing memory
  • Next by Date: Re: Releasing memory
  • Previous by thread: Re: A bit confused
  • Next by thread: Re: A bit confused
  • Index(es):
    • Date
    • Thread