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

Re: if statement


  • Subject: Re: if statement
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 27 May 2008 20:52:10 -0700

If you make this mistake often, go into your Project inspector, click the Build tab, and look for the item "Missing Braces And Parentheses" under "Warnings". Check its checkbox. This will cause the compiler to warn you when you do this. I also highly recommend enabling the "Treat Warnings As Errors" checkbox nearby, so that you can't miss the warning.

—Jens

On 27 May '08, at 2:28 PM, Nathan wrote:

Thanks.... I always always always forget that lol.
On May 27, 2008, at 5:25 PM, Hal Mueller wrote:


On May 27, 2008, at 2:24 PM, Nathan wrote:
if (OB=1) {

That's an assignment statement. In particular, it's an assignment statement that will always return true. You want (OB==1) or (1==OB).


H


_______________________________________________

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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >if statement (From: Nathan <email@hidden>)
 >Re: if statement (From: Nathan <email@hidden>)

  • Prev by Date: Re: Question concerning mouseDragged events.
  • Next by Date: Re: Question concerning mouseDragged events.
  • Previous by thread: Re: if statement
  • Next by thread: Re: if statement
  • Index(es):
    • Date
    • Thread