• 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: NSMenu itemAtIndex: problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMenu itemAtIndex: problem


  • Subject: Re: NSMenu itemAtIndex: problem
  • From: Andreas Mayer <email@hidden>
  • Date: Mon, 11 Nov 2002 05:55:23 +0100

Am Montag, 11.11.02 um 05:22 Uhr schrieb Tony:

What exactly does NSMenu's itemAtIndex: return when there is no item at that index?

I thought it would raise an exception. At least that's what the documentation says:

----
itemAtIndex:

- (id <NSMenuItem>)itemAtIndex:(int)index

Returns the menu item at location index of the receiver. It raises an exception if index is out of bounds.
----

while ([myMenu itemAtIndex: 0])
{
[myMenu removeItemAtIndex: 0];
}

Why not

while ([myMenu numberOfItems])


bye. Andreas.
_______________________________________________
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: 
 >NSMenu itemAtIndex: problem (From: "Tony" <email@hidden>)

  • Prev by Date: Re: NSMenu itemAtIndex: problem
  • Next by Date: [ANN] TimeDisc - clock app with source
  • Previous by thread: Re: NSMenu itemAtIndex: problem
  • Next by thread: NSMenu itemAtIndex: problem
  • Index(es):
    • Date
    • Thread