1

We have made the changes to our objective-c code as required by the transition to ARC. But now some code we have to draw on screen is not working.

We are getting: "-[Not A Type retain]: message sent to deallocated instance" against this line:

NSArray *colors = [NSArray arrayWithObjects:(__bridge id)startColor,
                                            (__bridge id)endColor, nil];

The local debug window shows that it is "startColor". startColor is a CGColorRef type and I cannot see it being de-allocated anywhere.

kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005
Jonathan Smith
  • 2,390
  • 1
  • 34
  • 60
  • 1
    Have you looked at the answer to this question already for an idea? http://stackoverflow.com/questions/7993516/not-a-type-retain-message-sent-to-deallocated-instance – Kevin Horgan Feb 24 '12 at 15:24

1 Answers1

0

Try "_bridge_retained" instead of "__bridge"

Avishay Cohen
  • 2,418
  • 1
  • 22
  • 40