RE: NSRunCriticalAlertPanel doesn't behave as I expected.
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