I am working on an iPad application which is converted to ARC. Application is for os >= ios 5.0. So my doubt is that, how do I manage viewOutlets? I use -(void)didReceivememoryWarning to set ViewOutlets to nil. But in ios 5.0 and 5.1 application shows lots of memory leaks. As -(void)viewDidUnload is deprecated in ios 6.0 , I am not using the same in the application. Is the correct way to manage outlets? Please give me a quick reply.
Managing View outlets in ios 5.0 and ios 6.0
114 views Asked by Abz Ios At
2
There are 2 answers
0
Dipak Narigara
On
ARC (automatic reference counting) features is available in iOS 5 and ahead (iOS 6 and so on..) version.
When you are using ARC unable in your project, you dont need to `manually release any object` that you have allocated for your stuff.
ARC will automatic handle this one.so it will beneficial for `Memory Management`.
Hope ,You understand what i m trying to say.
for more clarification , please refer below link: To ARC or not to ARC? What are the pros and cons? ARC, worth it or not?
Good Luck !!!
Related Questions in OBJECTIVE-C
- How to control the volume of an iPhone programmatically in objective-c
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- How to set value the descriptor of iOS BLE in Objective-C?
- Unexpected #selector() Behavior in Swift-Objective-C Interop?
- In what context can we use an unqualified #selector() expression in Swift?
- AVPictureInPictureController crashes during initialization
- How to use pow() in Objective-C?
- How to change the image on the MGSwipeButton in MGSwipeTableCell
- Using sort descriptors in Outline View
- Why is my Swift function not printing from inside the dataTask closure?
- Using UICollectionViewCell with IBOutlet
- Undefined symbol: _OBJC_CLASS_$_ only on simulator
- Why can't I receive a notification sent from Camera Extension(Swift) to an observer application (obj-c++)
- Behavior of __block modifier in objc
- Inserting subview into view where I've added subviews and sublayers
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 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)
There is NO DIFFERENCE in how you code for iOS 5 vs. iOS 6.
If you are having problems, it's because you don't understand what
viewDidUnloaddoes and when it's called.viewDidUnloadis called when the view of the controller is unloaded. In iOS 6, views are never unloaded. In iOS 5 and before, views were almost never unloaded either. So in both cases, pretty muchviewDidUnloadis never called.If your program is leaking stuff, it's because you are not releasing things. You always need to release instance variables in
dealloc. I suspect that this is your problem.When the controller's view is unloaded (which only happens in iOS 5 and before, but this is irrelevant),
viewDidUnloadallows you to optionally discard some resources to save memory, as long as they are resources that will be re-created when the view is loaded again. This usually includes properties and instance variables that are outlets (since when the view is loaded, it will load the Xib again and re-connect the outlets to new objects), as well as any variables that are set inviewDidLoad.If you coded your program correctly, I can go in there and remove
viewDidUnload, and it would not have any effect on the correctness of the program. (SinceviewDidUnloadis almost never called anyway.)You should almost never have to use
didReceiveMemoryWarningeither.