Questions tagged [viewdidunload]

62 questions
21
votes
3 answers

viewDidUnload no longer called in ios6

I just installed the new version of Xcode/ios6. viewDidUnload is now depreciated. In the apple doc, viewDidUnload [...] Deprecated in iOS 6.0. Views are no longer purged under low-memory conditions and so this method is never called. But numbers…
Martin
  • 11,881
  • 6
  • 64
  • 110
16
votes
3 answers

iOS 6 deprecation of viewWillUnload & move to didReceiveMemoryWarning

I'm new developer about to launch my first app. I'm confused about the deprecation of viewDidUnload as described below in Apple's iOS 6 release notes: In iOS 6, the viewWillUnload and viewDidUnload methods of UIViewController are now deprecated.…
10
votes
2 answers

The right place to call .removeObserver for NSNotificationCenter = Swift deinit()?

I've read a lot of suggestions for the right place to call .removeObserver for NSNotificationCenter since viewDidUnload is not an option. I was just wondering if the new deinit() in Swift would be a good choice? -nick
nick
  • 1,147
  • 1
  • 11
  • 12
7
votes
3 answers

What works in viewDidUnload should be moved to didReceiveMemoryWarning?

In new iOS 6, viewDidUnload is deprecated and we have been instructed to use didReceiveMemoryWarning instead, to manage objects in UIViewController instances and subclasses. Is it equally effective to assign nils to UIView kinds inside…
6
votes
3 answers

Why my UIViewController's view is being unloaded when visible?

This issue never happened to me. I have an UIViewController inside an UINavigationController. When a memory warning is received (nevermind the level), the viewDidUnload method of the visible controller is called, so the view is unloaded and I get an…
emenegro
  • 6,901
  • 10
  • 45
  • 68
6
votes
1 answer

When set objects to nil when using ARC?

I'm on an iPhone project using ARC. The application is a navigation based one, using UINavigationController. The typical use case is to go from a "main" UIViewController to a "secondary" UIViewController multiple times, maybe up to 100 times. The…
sonxurxo
  • 5,648
  • 2
  • 23
  • 33
4
votes
2 answers

Do I need to call [super viewDidUnload]?

I have seen some Apple examples that do call [super viewDidUnload]; and some that don't. I read an article (a few months ago so I dont recall the url) that said calling [super viewDidUnload]; was unnecessary but it didn't explain beyond that. Is…
chown
  • 51,908
  • 16
  • 134
  • 170
4
votes
3 answers

Best practices for releasing retained views?

Is this the correct (best?) way to release views retained in viewDidLoad, in iOS 4.x or lower? Is there anything else to consider? - (void) viewDidUnload { [super viewDidUnload]; [self releaseViews]; } - (void) dealloc { [self…
hpique
  • 119,096
  • 131
  • 338
  • 476
3
votes
2 answers

Best practice for adding/removing observers to/from NSNotificationCenter

What's the best practice for adding and removing observers to/from NSNotificationCenter? I'm wondering if adding self as an observer in viewDidLoad and removing self in viewDidUnload is sufficient. Or perhaps I should remove self in dealloc as…
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
3
votes
1 answer

How to recover from viewDidUnload(after memory warnings), using UISplitViewController

I'm making a split-view based iPad application(Portrait mode only), and I want to know how to recover initial state after viewDidUnload is called. When split-view application started for the first time,…
3
votes
1 answer

Lifecycle in MvvmCross

I have an Mvvmcross app that has a TableViewController in root. Each row opens a DetailViewController. And inside each one of it, you can edit it in a EditViewController. So I have a ViewModel for each view. I'm dealing with two problems here: 1 )…
Gabriel Bastos
  • 540
  • 1
  • 7
  • 16
3
votes
1 answer

XCode 4.5 auto generation of @synthesize

I understand that in xcode 4.5 it auto generates @synthesize and also implements the underscore prefix best practice to the variable assignment (as mentioned in another thread). I have TWO related question which your help will be greatly…
MoMo
  • 1,836
  • 1
  • 21
  • 38
2
votes
0 answers

Using viewDidLoad after didReceiveMemoryWarning and viewDidUnload

I am still trying to understand the process of managing views when meory warnings occur. I received some good information in this answer, but I still have questions. Suppose I have a view controller VC1 that contains a subview that is managed by…
2
votes
2 answers

iPhone - How to deal with low memory conditions

When the app receives a low memory warning message, 3 situations can happen : your app has just been launched and the user has not done anything special the app is running and there is a current context the app is in the background with some…
2
votes
1 answer

MonoTouch - get list of connected outlets

I am working on a large iOS application and am at the phase where I'm doing some cleanup/performance tuning. One of the things I need to do is override ViewDidUnload everywhere and take the appropriate action, and the most common thing that needs to…
jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182
1
2 3 4 5