Re: Compare NSNumber with an int
Re: Compare NSNumber with an int
- Subject: Re: Compare NSNumber with an int
- From: Óscar Morales Vivó <email@hidden>
- Date: Mon, 15 Dec 2003 12:09:59 +0100
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.
On 15 Dec 2003, at 11:50, Roberto wrote:
How can I compare an NSNumber with an int?
The first 2 methods return me errors
with:
if(Number == 10)
with:
if([Number isEqualToNumber]: 10)
or with??
_______________________________________________
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.
_______________________________________________
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.