• 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: NSRunCriticalAlertPanel doesn't behave as I expected.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSRunCriticalAlertPanel doesn't behave as I expected.


  • Subject: RE: NSRunCriticalAlertPanel doesn't behave as I expected.
  • From: "Smith, Bradley" <email@hidden>
  • Date: Fri, 21 Dec 2001 08:58:29 -0000

Classic C error where you wanted 2 equals operators rather than one. I avoid
making the mistake by doing this: -

if (NSAlertAlternateReturn == alertResult)

i.e. put the constant on the left hand side (I'm assuming
NSAlertAlternateReturn is a constant? I don't have the docs here right now),
this way if you miss off an equals operator the compiler will get upset
about it. Doesn't always work, for example when comparing 2 non const values
but since adopting this strategy a few years ago I've never made that
mistake (I've made plenty of other though!).

Merry Christmas and may all your operators be correct in the new year

Brad

> if (alertResult=NSAlertAlternateReturn){ // If the


  • Prev by Date: Re: division with long long
  • Next by Date: Re: Silly question
  • Previous by thread: Re: NSRunCriticalAlertPanel doesn't behave as I expected.
  • Next by thread: Re:CriticalAlert
  • Index(es):
    • Date
    • Thread