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

Re: isNotEqualToString


  • Subject: Re: isNotEqualToString
  • From: Gordon Apple <email@hidden>
  • Date: Fri, 13 Feb 2009 10:40:14 -0600
  • Thread-topic: isNotEqualToString

Or just replace the "||" with "&&".  DeMorgan's theorem.   Basic boolean
logic.


On 2/13/09 3:19 AM, "email@hidden"
<email@hidden> wrote:

> Subject: Re: isNotEqualToString
> To: Chunk 1978 <email@hidden>
> Cc: cocoa-dev Dev <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
>
>
> On 13 Feb 2009, at 10:00, Chunk 1978 wrote:
>
>> -=-=-=-
>> if ((![currentDesktopBackgroundImage isEqualToString:firstPath]) ||
>> (![currentDesktopBackgroundImage isEqualToString:secondPath]))
>> {
>> //Go South
>> }
>
> lets assume that currentDesktopBackgroundImage IS firstPath (and that
> secondPath ≠ firstPath)
>
> The first portion of your test gives false so it tries the second
> portion.
> This gives true, since currentDesktopBackgroundImage ≠ secondPath
>
> so you go south. Your version will always Go South UNLESS
> currentDesktopBackgroundImage == firstPath == secondPath
>
> I think you want this;
>
> if (!([currentDesktopBackgroundImage isEqualToString:firstPath] ||
> [currentDesktopBackgroundImage isEqualToString:secondPath]))
> {
> //Go South
> }
>
> Matt
>
> ------------------------------

G. Apple



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: How do I make one thread wait until another thread exits?
  • Next by Date: Re: System Preferences "halo/spotlight" effect
  • Previous by thread: Re: isNotEqualToString
  • Next by thread: System Preferences "halo/spotlight" effect
  • Index(es):
    • Date
    • Thread