Re: NSToolbar Problem
Re: NSToolbar Problem
- Subject: Re: NSToolbar Problem
- From: Guy English <email@hidden>
- Date: Fri, 1 Apr 2005 13:47:59 -0500
On Apr 1, 2005 1:28 PM, Julian Cain <email@hidden> wrote:
> Um, the are defined and draw just fine thank you. Sorry
You're just lucky. Sorry.
----------------------
_imageLeft = [[[NSImage imageNamed:@"TB_Segment_LeftCap"]
setFlipped:YES] retain];
----------------------
imageNamed: returns an NSImage*.
setFliped returns void.
retain returns an object.
What's happening here is that the NSImage is being returned into a
register then setFlipped is called on it. Since setFlipped returns
void there is ( and you're simply lucky here ) no change in the
register. Now you call retain and it picks up the value that's lying
around in the register and returns it after it's incremented the
retainCount. Your middle step is pure fluke that it works. And it's
certainly invalid code. Do you get a warning here? You should probably
get an error actually.
Guy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden