Re: Avoiding == and = mixup in if statements
Re: Avoiding == and = mixup in if statements
- Subject: Re: Avoiding == and = mixup in if statements
- From: Hasan Diwan <email@hidden>
- Date: Fri, 21 May 2004 09:43:48 -0700
Chris:
There are the -isEqualTo: and -isNotEqualTo: methods in Foundation,
eg:
BOOL areWeEqual = [@"Hasan Diwan" isEqualTo:@"Hasan Diwan"];
if (areWeEqual) NSLog(@"yes!");
Cheers!
>
On 21 May 2004, at 3:10, Christoffer Lerno wrote:
>
>
> Java disallows stuff like
>
>
>
> if (myObject=nil) { dosomething }
>
>
>
> Is it possible to maybe disallow the same potential error when I'm
>
> writing obj-c programs? Could I do something with the pre-processor
>
> perhaps?
Hasan Diwan {
http://ibn.com/~hdiwan}
OpenPGP Fingerprint: 275D 0E84 550C D92A 4A56 732C 8528 2579 E6E9 4842
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.