• 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: newbie - int and unsigned int
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie - int and unsigned int


  • Subject: Re: newbie - int and unsigned int
  • From: David Reed <email@hidden>
  • Date: Sun, 16 May 2004 20:53:58 -0400

unsigned myUnsignedInt = ABS(myInt); /* ABS is absolute value */

Justin, do yourself a favor and get a good book on C. If you don't know the language, you're going to have a hard time with Cocoa - it is basically an object model layered over C.

Your code snippet looks like you're calling unsignedIntValue on an int variable. This is an NSNumber method, but one cannot invoke methods on C types anyway.

David.

On Sunday, May 16, 2004, at 19:57 US/Eastern, justin webster wrote:

I cant figure out how to turn an int into an unsigned int.
i.e. get the value of the int without its plus/minus sign.

i'm trying something like this:

int myNewInt = integerOne + [(integerTwo - integerThree) unsignedIntValue];

and failing.

sorry 'bout the newbie question but i'm new to C and the apple documentation assumes a knowledge of C.
_______________________________________________
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.


References: 
 >newbie - int and unsigned int (From: justin webster <email@hidden>)

  • Prev by Date: Re: Recuperating after NS_HANDLER
  • Next by Date: Notification
  • Previous by thread: Re: newbie - int and unsigned int
  • Next by thread: [Q] Document app but with non-document opening window - how to do it?
  • Index(es):
    • Date
    • Thread