Re: Compare NSNumber with an int
Re: Compare NSNumber with an int
- Subject: Re: Compare NSNumber with an int
- From: "M. Uli Kusterer" <email@hidden>
- Date: Mon, 15 Dec 2003 14:41:12 +0100
At 12:09 Uhr +0100 15.12.2003, Sscar Morales Vivs wrote:
I'm getting it from heart, but it should be:
if([Number intValue] == 10)
or
if([Number isEqualToNumber:[NSNumber numberWithInt:10]])
The first solution is preferable as it doesn't create a spurious object.
The second, however, will also work if your NSNumber in Number
doesn't contain an integer.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.