LML
LML

Reputation: 1669

How to reduce memory usage in iOS app

My view contollers are completely dynamic which means controls are added to the view based on a screen xml doc. Now my app consumes around 3MB of memory even for orientation change. I have seperate screen xml for portrait and landscape!.There is not much images and only I have a background image of size 200kb.I am releasing all alloc memory and dealloc function for release properties.So there is no way to leakage,but the problem may be dynamic controls which are added to the view. Is there any way to solve this. There are some dictionaries also for caching but do not consumes much memory when the dynamic screen loaded memory shows a hike of 3MB thats the problem.

Upvotes: 0

Views: 1394

Answers (2)

Nikos M.
Nikos M.

Reputation: 13783

You should move your project to ARC and let the compiler do the retain-release stuff for you. Choose Edit>Refactor>Convert to Objective-C ARC. Also make sure to declare IBOutlet properties as (weak, nonatomic) after moving to ARC.

enter image description here

Upvotes: 1

rakeshNS
rakeshNS

Reputation: 4257

Allocate UI elements when they are visible to user. Dont hide UI elements instead remove those from views and release. If you use @property(nonatomic, retain), those objects will be active until your view controller deallocated.

Upvotes: 2

Related Questions