overt and covert retain-release question (instigated by UIViewController on iPhone)

2008-11-12 Thread Stuart Malin
First: sorry if iPhone questions now belong elsewhere, but I am posting here because I want to validate my understanding of retain- release in the Cocoa context. I've just acquired the book The iPhone Developer's Cookbook by Erica Sadun. Her first Hello World example (listing 1-4, if you

Re: overt and covert retain-release question (instigated by UIViewController on iPhone)

2008-11-12 Thread Luke the Hiesterman
Read up on the objective-c 2.0 language and the use of properties, specifically. This should help you understand what's going on here. What happens is that when you set self.view = contentView, the behind the scenes machinery is automatically sending a retain message to the object. This is

Re: overt and covert retain-release question (instigated by UIViewController on iPhone)

2008-11-12 Thread mmalcolm crawford
On Nov 12, 2008, at 10:00 AM, Stuart Malin wrote: - (void) loadVew { contentView = [[UIImageView alloc] initWithFrame]; ... self.view = contentView; [contentView release]; ... } *If* this is exactly the code shown, and contentView is an instance

Re: overt and covert retain-release question (instigated by UIViewController on iPhone)

2008-11-12 Thread Peter N Lewis
- (void) loadVew { contentView = [[UIImageView alloc] initWithFrame]; ... self.view = contentView; [contentView release]; ... } As Luke said, you need to read the Objective C 2.0 language section on properties. First off, you should understand