Re: release and reference counting query

2008-11-21 Thread mmalcolm crawford
On Nov 21, 2008, at 11:15 AM, Marc Stibane wrote: Am 19.11.2008 um 10:05 schrieb mmalcolm crawford: On Nov 18, 2008, at 10:33 AM, Marc Stibane wrote: Lets forget for a moment that the dealloc never get's called at all on the iPhone This is simply untrue. Nope. Try to set a breakpoint insi

Re: release and reference counting query

2008-11-21 Thread Marc Stibane
Am 19.11.2008 um 10:05 schrieb mmalcolm crawford: On Nov 18, 2008, at 10:33 AM, Marc Stibane wrote: Lets forget for a moment that the dealloc never get's called at all on the iPhone This is simply untrue. Nope. Try to set a breakpoint inside the dealloc in the same file as applicationDidF

Re: release and reference counting query

2008-11-19 Thread mmalcolm crawford
On Nov 18, 2008, at 10:33 AM, Marc Stibane wrote: Lets forget for a moment that the dealloc never get's called at all on the iPhone This is simply untrue. viewController = [[UIViewController alloc] initWithNibName:@"MoveMeView" bundle:[NSBundle mainBundle]]; since "viewC

Re: release and reference counting query

2008-11-19 Thread Marc Stibane
Am 18.11.2008 um 20:05 schrieb Andy Lee: On Nov 18, 2008, at 1:33 PM, Marc Stibane wrote: Am 07.11.2008 um 13:17 schrieb Roland King: On Nov 7, 2008, at 7:59 PM, Calum Robertson wrote: Below is a snippet of code from the "Creating an iPhone Application" document from the iPhone DevCenter.

Re: release and reference counting query

2008-11-18 Thread Andy Lee
On Nov 18, 2008, at 8:24 PM, Peter N Lewis wrote: I would actually write: self.viewController = [[[UIViewController alloc] initWithNibName:@"MoveMeView" bundle:[NSBundle mainBundle]] autorelease]; I like this best too. I like combining the autorelease with the alloc/ init because you don'

Re: release and reference counting query

2008-11-18 Thread Peter N Lewis
At 19:33 +0100 18/11/08, Marc Stibane wrote: what's the reason for defining a local variable aViewController to receive the UIViewController pointer, then copying that to the instance variable with a setter method which increases the retain count, then decrease the retain count again - instead

Re: release and reference counting query

2008-11-18 Thread Andy Lee
On Nov 18, 2008, at 1:33 PM, Marc Stibane wrote: Am 07.11.2008 um 13:17 schrieb Roland King: On Nov 7, 2008, at 7:59 PM, Calum Robertson wrote: Below is a snippet of code from the "Creating an iPhone Application" document from the iPhone DevCenter. - (void)applicationDidFinishLaunching:(UIApp

Re: release and reference counting query

2008-11-18 Thread Marc Stibane
Am 17.11.2008 um 19:34 schrieb j o a r: On Nov 17, 2008, at 10:02 AM, Marc Stibane wrote: So why the local var? 3 lines of code instead of 1... Isn't a main goal of Cocoa to write *less* code? The main goal for most programmers is not to write less code, it's to write maintainable code [*].

Re: release and reference counting query

2008-11-18 Thread Marc Stibane
-- sorry, repost (went to the wrong list yesterday) Am 07.11.2008 um 13:17 schrieb Roland King: On Nov 7, 2008, at 7:59 PM, Calum Robertson wrote: Below is a snippet of code from the "Creating an iPhone Application" document from the iPhone DevCenter. - (void)applicationDidFinishLaunching:(U

Re: release and reference counting query

2008-11-07 Thread Calum Robertson
Thanks for the solution guys - I fully understand now! Also thanks for the advice and the super quick replies. C On 7 Nov 2008, at 12:17, Roland King <[EMAIL PROTECTED]> wrote: the iPhone documentation - I guess because it's recent, tends to use properties quite a lot. You'll even find in t

Re: release and reference counting query

2008-11-07 Thread Roland King
the iPhone documentation - I guess because it's recent, tends to use properties quite a lot. You'll even find in the class description documentation that things are documented as properties instead of setXXX and XXX methods (and it tells you which are readwrite and readonly etc.). In this

Re: release and reference counting query

2008-11-07 Thread Filip van der Meeren
I am not sure, but I am guessing the class that self refers to, defined viewController as a property that retains the object assigned to it. Remember, there is a difference between "self->" and "self.". The -> refers to the variables of the object, and "." refers to the properties. On 07 N

release and reference counting query

2008-11-07 Thread Calum Robertson
Hi, Below is a snippet of code from the "Creating an iPhone Application" document from the iPhone DevCenter. I'm not clear as to why this works. My understanding is that when [UIViewController alloc] is executed, the retain count is 1 and then when [aViewController release] is called, the retai