• 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: null values in NSArray ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: null values in NSArray ???


  • Subject: Re: null values in NSArray ???
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Fri, 17 Jan 2003 11:17:54 -0500

On Friday, Jan 17, 2003, at 10:48 US/Eastern, Bob Miller wrote:

Hello,

Can anyone tell me if it is possible to manage an NSMutableArray that contains null values for objects at any given index ? I'd like to be able to have an array such as this so that each location can be filled as a 'place holder' so that if a particular object at any given index is null, it gets ignored or possibly populated with an object id. It seems that this would be a nice feature to have.

No, NSArray/NSMutableArray will never contain nil. The closest thing you can do is use NSNull.

I don't want to incur the overhead of the NSNull object allocation(s) in a large grid.

I seriously doubt that NSNull has much overhead. In fact, it appears that NSNull is a singleton, so no matter how many times you call [NSNull null] (or [[NSNull alloc] init]), there is only one instance of NSNull in your application.

Can it be done by catching the null object exception ?

I doubt it.
_______________________________________________
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: 
 >null values in NSArray ??? (From: Bob Miller <email@hidden>)

  • Prev by Date: Re: null values in NSArray ???
  • Next by Date: Re: inheritance issues
  • Previous by thread: Re: null values in NSArray ???
  • Next by thread: Re: null values in NSArray ???
  • Index(es):
    • Date
    • Thread