Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Papa-Raboon
Hi All, Anybody know where can I get some examples of if() conditionals being used with string variables in Objective-C? To be specific, I am trying to use an if conditional to check the value of a string being a certain value and then replacing it with a different value if the condition returns

Re: Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Jean-Daniel Dupas
Le 25 juin 08 à 14:24, Papa-Raboon a écrit : Hi All, Anybody know where can I get some examples of if() conditionals being used with string variables in Objective-C? To be specific, I am trying to use an if conditional to check the value of a string being a certain value and then

Re: Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Mike Abdullah
if ([theName isEqualToString:@John Lennon]) { theName = @Ringo Starr; } -- By using == you were checking to see if the strings were the same object. Sometimes this would, sometimes it would not. Instead, you want to check if the two objects have equivalent contents.

Re: Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Dan Uff
Hi, Check Google. Just type in examples of if() conditionals (with the quotes). Hope this helps, Dan On Jun 25, 2008, at 8:24 AM, Papa-Raboon wrote: Hi All, Anybody know where can I get some examples of if() conditionals being used with string variables in Objective-C? To be

Re: Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread I. Savant
On Wed, Jun 25, 2008 at 10:51 AM, Dan Uff [EMAIL PROTECTED] wrote: Check Google. Just type in examples of if() conditionals (with the quotes). Perhaps you skimmed the original request - the problem was really how to compare NSString instances ( if() not withstanding). -- I.S.

Re: Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Michael Vannorsdel
You can do: if([theName isEqualToString:@John Lenon]) //do stuff NSString has some comparison methods in the class listing. The above example will ask two different NSString objects if they have the same string values. On Jun 25, 2008, at 8:24 AM, Papa-Raboon wrote: Hi All,