Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-25 Thread Frédéric Testuz
Le 25 févr. 09 à 18:37, mmalc Crawford a écrit : mmalc OK, thank you Frédéric ___ Cocoa-dev mailin

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-25 Thread mmalc Crawford
mmalc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mode

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-25 Thread Frédéric Testuz
Le 25 févr. 09 à 00:44, Jonathan Hess a écrit : On Feb 20, 2009, at 1:05 AM, Alexander Spohr wrote: Am 20.02.2009 um 04:18 schrieb mmalc Crawford: On Feb 19, 2009, at 12:34 PM, mmalc Crawford wrote: See also updated:

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-24 Thread Jonathan Hess
On Feb 20, 2009, at 1:05 AM, Alexander Spohr wrote: Am 20.02.2009 um 04:18 schrieb mmalc Crawford: On Feb 19, 2009, at 12:34 PM, mmalc Crawford wrote: See also updated: The Doc states: Y

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-20 Thread mmalc Crawford
On Feb 20, 2009, at 1:05 AM, Alexander Spohr wrote: You should therefore also set outlet variables to nil in dealloc: - (void)dealloc { // release outlets and set outlet variables to nil [anOutlet release], anOutlet = nil; [super dealloc]; } why not just use [sel

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-20 Thread Alexander Spohr
Am 20.02.2009 um 04:18 schrieb mmalc Crawford: On Feb 19, 2009, at 12:34 PM, mmalc Crawford wrote: See also updated: The Doc states: You should therefore also set outlet variables to nil in

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread mmalc Crawford
On Feb 19, 2009, at 12:34 PM, mmalc Crawford wrote: See also updated: Just to try to forestall what will probably otherwise be a flood of feedback; yes, there's a typo: [super release]; shou

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread mmalc Crawford
On Feb 19, 2009, at 2:01 PM, mmalc Crawford wrote: On Feb 19, 2009, at 1:57 PM, James Montgomerie wrote: I feel like I may have opened a can of worms here. I think Ricky just closed it -- thanks. And your post afforded a good opportunity to point to the updated documentation, so thanks for

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread Ricky Sharp
On Feb 19, 2009, at 3:57 PM, James Montgomerie wrote: I feel like I may have opened a can of worms here. Nope; my fault. All this time I had misread the whole point of the threads. My app has never received low-memory warnings. So my observations in turn have nothing to do with it. I

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread mmalc Crawford
On Feb 19, 2009, at 1:57 PM, James Montgomerie wrote: I feel like I may have opened a can of worms here. I think Ricky just closed it -- thanks. mmalc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread Ricky Sharp
On Feb 19, 2009, at 3:52 PM, mmalc Crawford wrote: On Feb 19, 2009, at 1:41 PM, Ricky Sharp wrote: Perhaps this is just how I've coded things, but I've seen views get unloaded and reloaded perfectly without any leaks. This isn't the issue. The issue is how much memory can you free up in

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread James Montgomerie
On 19 Feb 2009, at 21:41, Ricky Sharp wrote: On Feb 19, 2009, at 2:18 PM, James Montgomerie wrote: Returning to this months-old thread... Apologies for the length of the mail, I thought it best to summarise what went before. I now have shipping iPhone OS apps and during all my tests and

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread mmalc Crawford
On Feb 19, 2009, at 1:41 PM, Ricky Sharp wrote: Perhaps this is just how I've coded things, but I've seen views get unloaded and reloaded perfectly without any leaks. This isn't the issue. The issue is how much memory can you free up in response to a memory warning. If you don't follow t

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread Ricky Sharp
On Feb 19, 2009, at 2:18 PM, James Montgomerie wrote: Returning to this months-old thread... Apologies for the length of the mail, I thought it best to summarise what went before. I now have shipping iPhone OS apps and during all my tests and analyzing things in Instruments (connected to

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread mmalc Crawford
On Feb 19, 2009, at 12:18 PM, James Montgomerie wrote: Is the reason that the setView: approach is preferred that, despite what the docs and comments in the files say, the superclass' didReceiveMemoryWarning might /not/ actually release the view, even if it doesn't have a superview It's

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-19 Thread James Montgomerie
Returning to this months-old thread... Apologies for the length of the mail, I thought it best to summarise what went before. I suggested that an appropriate implementation for didReceiveMemoryWarning in a UIViewController subclass would be On 22 Nov 2008, at 15:58, James Montgomerie wrot

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-23 Thread mmalcolm crawford
On Nov 22, 2008, at 8:29 AM, mmalcolm crawford wrote: Let me check on this one. It seems that, for various reasons, the setView: approach is still preferred. mmalc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-22 Thread Alexander Spohr
Am 22.11.2008 um 01:53 schrieb mmalcolm crawford: - (void)dealloc { // release outlets and set variables to nil [anOutlet release], anOutlet = nil; [super release]; } [super dealloc] ? ;) atze ___ Cocoa-dev mailing list (Cocoa-de

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-22 Thread James Montgomerie
On 22 Nov 2008, at 16:29, mmalcolm crawford wrote: On Nov 22, 2008, at 8:16 AM, mmalcolm crawford wrote: [...] Sorry, pressed Deliver on the wrong message by mistake. Let me check on this one. Oops, sorry, looks like we're mailing around each other now... Jamie. ___

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-22 Thread James Montgomerie
But I'm assuming that self.anOutlet will be valid if and only if self.view is already valid (in which case the call to self.view.superview should be safe, no?). Under this assumption, if self.anOutlet is nil, the && be short- circuited and self.view never called; if it is valid, it's safe to

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-22 Thread mmalcolm crawford
On Nov 22, 2008, at 8:16 AM, mmalcolm crawford wrote: [...] Sorry, pressed Deliver on the wrong message by mistake. Let me check on this one. mmalc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moder

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-22 Thread mmalcolm crawford
On Nov 22, 2008, at 7:58 AM, James Montgomerie wrote: if(self.anOutlet && !self.view.superview) { On Nov 19, 2008, at 12:59 AM, mmalcolm crawford wrote: You could invoke 'view': - (void)didReceiveMemoryWarning { if ([self.view superview] == nil) { // set outlets to nil

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-22 Thread James Montgomerie
On 22 Nov 2008, at 00:53, mmalcolm crawford wrote: Context: UIViewController provides a method, didReceiveMemoryWarning, which is invoked on view controllers when the amount of memory available to the application is severely constrained. The goal of the method is to allow view controller

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-21 Thread mmalcolm crawford
On Nov 21, 2008, at 5:21 PM, Ricky Sharp wrote: But, that's only if dealloc releases objects directly and doesn't use accessors or use the workaround shown below. Yes, although following "best practice" is assumed... :-) I'm now really curious as to why UIViewController uses an accessor

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-21 Thread Ricky Sharp
On Nov 21, 2008, at 6:53 PM, mmalcolm crawford wrote: This leaves us for now with two solutions: (a) Greg's (override setView:) which is more future-proof but is in many respects academically unsatisfying. - (void)setView:(UIView *)aView; { if (!aView) { // set outlets to nil, e

Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2008-11-21 Thread mmalcolm crawford
Context: UIViewController provides a method, didReceiveMemoryWarning, which is invoked on view controllers when the amount of memory available to the application is severely constrained. The goal of the method is to allow view controllers to dispose of resources that are currently not ne