In iOS6 the method viewDidUnload became deprecated, the memory management has changed a lot for a UIViewController. Here is a little brief about the new patterns.
The part that occupies more memory in a view controller is the view (and of course huge data that you would eventually create). The view itself it doesn't consume so much memory, is the backing store, the part that is drawn (for the most curious is the CABackingStore). This new pattern seems to check as volatile the memory occupied by all the backing stores owned by view controllers' views that are not displayed in a window. When a memory warning comes this backing store will be purged from memory. With this method you can save the process of recreating the view that is quite expensive.
Apple says that is safe to remove viewDidUnload/viewWillUnload from also iOS5 project and even if you set the deployment target to iOS5 the templates don't show those methods. I understand that if the outlets owned by the view are weak, when you release the view controller's view in the superclass implementation everything will be dealloc correctly without leaks or zombies thanks to ARC.
Since I really appreciate this new approach I'm not confident with this kind of situation: let's suppose that we have a view controller and its view, this view is just a content view that will host different views created in the view controller's xib, changing them at runtime dynamically. When you create outlets for this views they are automatically created as strong and that makes sense because the the "main view" doesn't own none o f them.
Regarding the new rules the backing store of this views will not be signed as volatile since they are not owned by the main view in iOS6 and in iOS5 (if I remove the viewDidUnLoad) they will be not released for the same reason.
How can i manage this situation? It will be correct to release them inside the didReceiveMemoryWarning? but were can I recreate them in iOS6 if the view will be loaded only once ?
viewDidUnload deprecation, but what about strong references to secondary view?
484 views Asked by Andrea At
0
There are 0 answers
Related Questions in IOS5
- How to change elements positioning in landscape mode?
- How to set BarChartDataEntry labels (String not Double) not xaxis labels
- how to add variations to different phone sizes with the same size class
- can i get sim serial number from ios mobile for my ios app using ios programming?
- splash screen error with xcode 9.2
- How to open file:///private/var/mobile/Containers/Shared/AppGroup/ folder on Mac?
- Thread 1:EXC_BAD_ACCESS(code=1,address=0x20004018) How to solve this?
- Migrating 32bit iOS app to 64bit
- How to enable/disable a button while validating a button?
- in switch case i want to print nslog as per my requirement?
- how to add namearr array to my dictionary
- SearchBar method deprecated issue
- Apns notifications is not Working with Developement Certificate
- Swift Parse Race Conditions
- first page open response like classplbuildpublish error
Related Questions in VIEW
- Opening sheet in SwiftUI view
- Get json field value in sqlite model from view django
- I don't understand which databases are invalid
- View is not refreshing
- Changes to my model/viewmodel are not charging what's on my view
- How to create a text sticker view in swift, like in Canva App, which is resizable as per the text content in it
- SQL Tranformations in view or stored procedure?
- SQL query getting too slowly when using IIF in a view column that is using aggregate results from a previous view. see below example for a clarity
- How to add focus in AndroidView field
- Angular 17 does not update view using setInterval with NG0500 error in console
- How to use std::ranges::set_symmetric_difference over a non sorted range?
- AUTH_USER_MODEL refers to model 'Socialmedia.User' that has not been installed
- Is it possible to show columns really used in a view
- Can't render views of html in django
- Entity Framework Core add relationship between view and standard model objects
Related Questions in IOS6
- How to create an Objective-C project in an old version
- Is it possible to force Ios browser focus from input to another element?
- When was libc++ introduced in iOS?
- Require Xcode version to develop iOS 6 applications for iPad 4th Gen
- Swift - Make a Slide to Unlock like button in iOS 6
- Multiple versions for different iOS versions as one application
- How to detect iOS version in Objective C?
- Swift 3 Segue Q!- Prototype Cell to Multiple VCs - Using didSelectRowAtIndexPath
- Can I still develop apps for iOS6 in 2017?
- how to gat a value from an array which contain in an object and object already in an array while using json response?
- Programatically adding a iOS 6 look alike gradient UIButton
- I want to display device contact user
- How to create circle shape UITableView in iOS?
- I'm getting in this program stack or it stops to work
- How to keep iphone anonymous from iOS app?
Related Questions in DIDRECEIVEMEMORYWARNING
- Game created in Unity is too slow & crashes after built to to iPad. How to fix this?
- How to detect "OutOfMemory" in UWP or UWP equivalent for "didRecieveMemoryWarning" in ios
- didReceiveMemoryWarning removes cells/views from UITableView hierarchy
- Why loading AssetBundle to memory after downloading and unpacking results crash in iPad due to lack of Memory?
- Xcode doesn't automatically create viewDidLoad method
- fix the memory issue warning when leaks in unable to find it
- Swift Mapkit Received memory warning
- How to clean the memory properly (conceptual, SWIFT)
- How to detect memory warnings in iOS App Extension
- receiving memory warning in simple uipageviewcontroller app
- Why is iOS sending memory warning to deallocated objects, causing my app to crash?
- Using NSCache instead of NSMutable dictionary for reclaimable data
- How to implement didReceiveMemoryWarning in Swift?
- Anonymous VM is too much high
- didReceiveMemoryWarning capabilities: how much could app do
Related Questions in VIEWDIDUNLOAD
- What is the pair method for viewDidLoad if viewDidUnload is deprecated?
- App view seems to reload back to default after some time
- Lifecycle in MvvmCross
- The right place to call .removeObserver for NSNotificationCenter = Swift deinit()?
- Way to remove all -viewDidUnload from project's view controllers
- iOS UIViewController,why "self" become to "wild pointer" in viewDidUnload?
- Release memory in ARC based APP?
- Managing View outlets in ios 5.0 and ios 6.0
- In XCode 4.6.2, why does creating an outlet on a UITextView auto-generate a viewDidUnload method
- App running slow after loading viewcontroller, then unload about 15-20 times
- NSNotification & didReceiveMemoryWarning in iOS 6
- Memory management of view while using NavigationController
- didReceiveMemoryWarning using a Tab Bar
- Release retained property pointing at self.view
- Method for release resources in iOS 6.0
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)