Re: Swift question
Re: Swift question
- Subject: Re: Swift question
- From: Ronald Lingl <email@hidden>
- Date: Wed, 04 Jun 2014 13:17:24 -0700 (PDT)
What am I missing here? The condition is if hammers equals 1, which it does. So the statement should always be executed.
That is why he gets the correct result of hammer in the output.
From: Avery Pierce <email@hidden>
To: David Delmonte <email@hidden>
Cc: Xcode Users <email@hidden>
Sent: Wednesday, June 4, 2014 12:08 PM
Subject: Re: Swift question
> If hammers does not equal 1, it also works, but I get a compiler warning: “Will never be executed” on the hammerTitle = " hammer" statement.
Makes sense. If you hard-coded the number of hammers (and there's no place where hammers could possibly change), then there are no code paths that could result in that if block being executed.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden