• 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: Why add a nil item to an NSArray ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why add a nil item to an NSArray ?


  • Subject: Re: Why add a nil item to an NSArray ?
  • From: Dave Hersey <email@hidden>
  • Date: Mon, 27 Jun 2005 15:23:56 -0400

Because... That's the spec for the method.

> - (id)initWithObjects:(id)anObject...
> Initializes a newly allocated set with members taken from the specified list
> of objects. initWithObjects: takes a comma-separated list of objects
> terminated by nil...

?

- Dave

On 6/27/05 3:08 PM, "Martin Ottenwaelter" <email@hidden>
wrote:

> Hi,
>
> Why doesn't that works :
> [NSArray initWithObjects:@"First",@"Second"];
>
> Why do I have to add that nil item for the NSArray to be ok ?
> [NSArray initWithObjects:@"First",@"Second",nil];
>
> Thanks.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why add a nil item to an NSArray ?
      • From: Bill Cheeseman <email@hidden>
References: 
 >Why add a nil item to an NSArray ? (From: Martin Ottenwaelter <email@hidden>)

  • Prev by Date: Re: Convert PICT to NSImage
  • Next by Date: Re: Convert PICT to NSImage
  • Previous by thread: Why add a nil item to an NSArray ?
  • Next by thread: Re: Why add a nil item to an NSArray ?
  • Index(es):
    • Date
    • Thread