• 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
unsigned long long + id = ???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unsigned long long + id = ???


  • Subject: unsigned long long + id = ???
  • From: Claudio Procida <email@hidden>
  • Date: Thu, 8 Feb 2007 21:49:53 +0100

I have a class Foo with a method -(unsigned long long)size.

I realized today that when I get an id reference to an object of class Foo, if I don't explicitly cast to (Foo *), the result is meaningless.
I didn't check, but it *seems* to be interpreted as signed int


Here's the code:

- (id)outlineView:(NSOutlineView *)outlineView
    objectValueForTableColumn:(NSTableColumn *)tableColumn
		   byItem:(id)item {
//...
NSLog(@"s:%qu", [item size]);
NSLog(@"s:%qu", [(Foo *)item size]);


And the results:

2007-02-08 21:19:40.093 Singular[19919] s:14065436521166900
2007-02-08 21:19:40.094 Singular[19919] s:6212

Why??

--
Claudio Procida
Emeraldion Lodge
http://www.emeraldion.it


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: unsigned long long + id = ???
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: delegate issue?
  • Next by Date: Re: unsigned long long + id = ???
  • Previous by thread: Re: NSKeyedArchiver not saving as binary data
  • Next by thread: Re: unsigned long long + id = ???
  • Index(es):
    • Date
    • Thread