FROM : Greg
DATE : Fri Jul 25 23:47:58 2008
Are you retaining that NSColor object to make sure it sticks around?
- Greg
On Jul 25, 2008, at 5:40 PM, Ashley Perrien wrote:
> I have a custom NSView that contains as an instance variable a
> color. If I set the color in init as lineColor = [NSColor
> blueColor]; all is well. If instead I use [NSColor
> colorWithCalibratedRed: 0.5 green: 0.5 blue: 1.0 alpha: 1.0], the
> program crashes if I try and access or change the color later. The
> initial draw using it is just fine. But the next time it's redrawn
> or if I change the color, everything crashes. I have the exact same
> problem in 2 completely different applications. I'd like to be able
> to initialize the colors with something other than the default
> redColor, blueColor, etc. I've also tried one or two of the other
> ways to specify values and have had the same problem. Any ideas on
> what's going on?
>
> Ashley Perrien
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/greg
> %40kinostudios.com
>
> This email sent to <email_removed>
DATE : Fri Jul 25 23:47:58 2008
Are you retaining that NSColor object to make sure it sticks around?
- Greg
On Jul 25, 2008, at 5:40 PM, Ashley Perrien wrote:
> I have a custom NSView that contains as an instance variable a
> color. If I set the color in init as lineColor = [NSColor
> blueColor]; all is well. If instead I use [NSColor
> colorWithCalibratedRed: 0.5 green: 0.5 blue: 1.0 alpha: 1.0], the
> program crashes if I try and access or change the color later. The
> initial draw using it is just fine. But the next time it's redrawn
> or if I change the color, everything crashes. I have the exact same
> problem in 2 completely different applications. I'd like to be able
> to initialize the colors with something other than the default
> redColor, blueColor, etc. I've also tried one or two of the other
> ways to specify values and have had the same problem. Any ideas on
> what's going on?
>
> Ashley Perrien
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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/greg
> %40kinostudios.com
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Ashley Perrien | Jul 25, 23:40 | |
| Greg | Jul 25, 23:47 | |
| Graham Cox | Jul 26, 03:25 |






Cocoa mail archive

