• 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
Array question, Obj-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Array question, Obj-C


  • Subject: Array question, Obj-C
  • From: Hisaoki Nishida <email@hidden>
  • Date: Fri, 24 May 2002 20:06:36 -0400

Hi,

I have a need to allocate a dynamically allocated array and I was wondering how I create it in Obj-C? Or, would it be wise to use NSArray? I am trying to use NSMutableArray to add simple NSNumber objects to it. Below is how I do it, I want to know if it's the correct way to do it:


NSMutableArray * VCellWallArray; // at init stage
NSNumber * wrapped; // at init stage


LOOP{
. // do some stuff here to get xCount
.
.
wrapped = [NSNumber numberWithInt:xCount];
[VCellWallArray addObject:wrapped];
}

My question is, is VCellWallArray being added the correct xCount value every time the loop is executed? Is it just adding a pointer and destroying the link everytime a new value is assigned to wrapped?

Thanks!
_______________________________________________
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.

  • Follow-Ups:
    • Re: Array question, Obj-C
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Adding <NSCoding> to NSTextStorage, or not.
  • Next by Date: Length of globallyUniqueString
  • Previous by thread: Re: Adding <NSCoding> to NSTextStorage, or not.
  • Next by thread: Re: Array question, Obj-C
  • Index(es):
    • Date
    • Thread