0

When I simulate a memory warning, viewDidUnload should run on unused objects, right?

How do I go about figuring out WHY my UIView won't go away?

FYI I'm using ARC and every ivar is an IBOutlet and looks like:

@property (nonatomic, weak) IBOutlet UIView *someView;
Jacksonkr
  • 31,583
  • 39
  • 180
  • 284
  • What do you mean by "go away"? Are you expecting your view to have a `nil` value after `viewDidUnload`? – N_A Mar 29 '12 at 17:57
  • I want it to go out of memory, so in a roundabout way I suppose I do expect a nil value (or something similar). I'm ultimately just trying to make sure my memory management is in check. – Jacksonkr Mar 29 '12 at 20:26

1 Answers1

1

What class are we looking at here? Only UIViewControllers release their view in case of a mem warning.

If this is a custom class or a custom added view, you should unload it yourself.

Rengers
  • 14,911
  • 1
  • 36
  • 54
  • And the view is the 'main view' associated with this controller? Or is it a custom view you added yourself? – Rengers Mar 30 '12 at 11:31
  • it's view I added my self. fyi this view is associated to it's OWN nib. – Jacksonkr Mar 30 '12 at 18:40
  • Views that you added and retained yourself will not be released in case of a memory warning. You need to do this yourself. That's what the `viewDidUnload` method` can be used for. But, it looks like you don't actually retain the view... – Rengers Mar 31 '12 at 13:02
  • I'm using ARC so I would assume ARC would take care of the retain/release. Maybe I am mistaken? – Jacksonkr Apr 01 '12 at 03:24