• 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: Tony Cate <email@hidden>
  • Date: Sun, 10 Nov 2002 22:51:08 -0600

On Sun, 10 Nov 2002 23:22:46 -0500 (EST), Tony wrote:
> while ([myMenu itemAtIndex: 0])
> {
> [myMenu removeItemAtIndex: 0];
> }
>
> But this results in a infinite loop.

WARNING! WARNING! The following is a wild hairy guess. (I'm still
kinda new.)

Because the while statement isn't really testing anything. itematIndex
returns a menu item. You have to test to see if anything is there. Try:

while([myMenu itemAtIndex:0] != nil)
{
........
}
_______________________________________________
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: NSMenu itemAtIndex: problem
  • Next by Date: Re: NSMenu itemAtIndex: problem
  • Previous by thread: NSMenu itemAtIndex: problem
  • Next by thread: Re: NSMenu itemAtIndex: problem
  • Index(es):
    • Date
    • Thread