FROM : Corbin Dunn
DATE : Wed Jun 21 20:14:18 2006
On Jun 20, 2006, at 11:32 PM, Vinay Prabhu wrote:
> My observation here is if the values of the var's
> red and redEdit are different, it doesn't crash.
> If the values of the red and redEdit is same it will crash.
>
> If the crash is because of missing retain, it should crash in both the
> cases...
Your code clearly is missing a retain; you must retain the color.
> Am I right?
No, you aren't. Some colors are retained by the system (ie: [NSColor
redColor] etc). Other colors that are created are not. You must always
properly retain/release the colors you store as ivars.
-corbin
DATE : Wed Jun 21 20:14:18 2006
On Jun 20, 2006, at 11:32 PM, Vinay Prabhu wrote:
> My observation here is if the values of the var's
> red and redEdit are different, it doesn't crash.
> If the values of the red and redEdit is same it will crash.
>
> If the crash is because of missing retain, it should crash in both the
> cases...
Your code clearly is missing a retain; you must retain the color.
> Am I right?
No, you aren't. Some colors are retained by the system (ie: [NSColor
redColor] etc). Other colors that are created are not. You must always
properly retain/release the colors you store as ivars.
-corbin
| Related mails | Author | Date |
|---|---|---|
| Vinay Prabhu | Jun 20, 10:39 | |
| Corbin Dunn | Jun 21, 00:34 | |
| Vinay Prabhu | Jun 21, 07:41 | |
| Chris Suter | Jun 21, 07:50 | |
| Vinay Prabhu | Jun 21, 08:32 | |
| Corbin Dunn | Jun 21, 20:14 | |
| Uli Kusterer | Jun 21, 20:35 |






Cocoa mail archive

