3 ms·
ARC Gotcha – Unexpectedly Short Lifetimes
- sc68cal 15y ago>What could be releasing objects automatically? ARC – that’s its job. From ARC’s point of view, the UIColor created with -colorWithRed:... was used to access the CGColor, and then is no longer needed. So why not use the following? (My ObjC is very rusty) [[self.view layer] setBackgroundColor: [UIColor colorWithRed: 0.2 green: 0.3 blue: 0.4 alpha: 1.0].CGColor ]