Solved my own problem, which had nothng to do with what I thought it had to
do with. The source of the difficulty is actually this: On Snow Leopard,
[self controlView] works - it points from the NSCell to the NSMatrix that
contains it. On Leopard, it doesn't work.

I don't know why it doesn't work on Leopard, but I don't really care; I have
another way to get a reference to the NSMatrix, and that's all I need, so
now my code works fine on both Leopard and Snow Leopard.

Sorry for the misstatement of the problem. m.

On Fri, 30 Oct 2009 22:06:09 -0700, Matt Neuburg <[email protected]> said:
>I'm building on Snow Leopard but I want to run on Leopard too. I'm calling
>NSMatrix's cellFrameAtRow:column: from an NSCell, like this:
>
>NSInteger row, col;
>[(CardMatrix*)[self controlView] getRow:&row column:&col ofCell:self];
>NSRect myFrame = [
>  (CardMatrix*)[self controlView] cellFrameAtRow:row column:col];
>
>I can see from logging that this gives the right answers on my SnowLeopard
>machine. For example, the NSRect of cell (0,0) is reported as
>
>{{0, 0}, {130.5, 167.25}}
>
>But on the Leopard machine it's reported as
>
>{{608, 0}, {20, 0}}
>
>I believe things really are going wrong (i.e. it isn't just the way I'm
>logging) because myFrame causes Bad Things to happen later on in the code on
>the Leopard machine. On Snow Leopard everything's fine.
>
>I have a vague feeling that all this is due to something about 64-bit, and
>maybe NSRect vs. CGRect, but what? Do I need to do some kind of tricky
>conditional compilation and cast somehow? Do I need to tweak my build
>settings? (I tried building 32-bit only but it made things worse.) Thx.


-- 
matt neuburg, phd = [email protected], <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



_______________________________________________

Cocoa-dev mailing list ([email protected])

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to