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

Re: If Functions


  • Subject: Re: If Functions
  • From: "I. Savant" <email@hidden>
  • Date: Mon, 12 Jun 2006 08:50:15 -0400

Giles:

Oh, it's documented. :-) You have to learn to separate the Frameworks / API (Cocoa) from the language (Objective-C). Look into Apple's Objective-C documentation and you'll see that the flow control works the same as most others:

if (someConditionIsTrue)
{
  [someObject doSomething];
} else {
  [someObject doSomethingElse];
}

As to how to accomplish your goal, you would want to see if ([myString isEqualToString:@"yes"]), though this doesn't strike me as the best strategy.

I recommend going through all Apple's tutorials on the developer site very carefully. Keep going over them until you understand them. Then pick up a good book (search this list's archives for the many recommendations it contains) and start at chapter one. You'll do yourself no favors by jumping right into a project without the proper research tools and without taking the time to familiarize yourself with their use.

  I hope this is helpful.

--
I.S.


On Jun 11, 2006, at 5:58 AM, Giles Williams wrote:

I have a really simple question, which I cannot find the answer to anywhere.

How do I do an If() function in Cocoa? It does not seem to be documented!

I have a string variable that will be equal to either "yes" or "no". How do I do this?

Giles Williams.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >If Functions (From: Giles Williams <email@hidden>)

  • Prev by Date: Re: Using NSClassFromString with a Custom Class
  • Next by Date: Re: Using NSClassFromString with a Custom Class
  • Previous by thread: Re: If Functions
  • Next by thread: Re: If Functions
  • Index(es):
    • Date
    • Thread