开发者

iPhone Development Memory Warnings

I know people here can help me with my problem in memory warnings on my app. I have multiple objects added to my Nib file, connected them to multiple IBOutlets and release these outlets on my viewDidUnload and dealloc method, I also set them to nil, but it still keeps on crashing after the "Received Memory Warning = Level 1" error message. I used NWPickerField for my objects in Nib files.

http://cocoacontrols.com/platf开发者_如何学JAVAorms/ios/controls/nwpickerfield

I just hope anyone here have tried using this :) thanks and Cheers!


If you're crashing when you receive the memory warning, that usually means that something gets deallocated, but it's pointer isn't set to nil, you try to access it, and Crash!

Errors like this can be hard to track down. A few types: You can play around with XCode instruments (using Build&Profile in XCode 4) - specifically the Zombies one, which 'keeps dead objects around (as Zombies)', but let's you know when they get accessed. Another useful one is a watchpoint. Once the simulator is running, right click a variable in console, and say 'Watch this address'. Then any line of code that causes a change to that memory location will cause a breakpoint when it occurs. Another thing to try is just to run through all your ivars, inits, and deallocs, and make sure you really did get every case.


As you mentioned in your question.

I also set them to nil,

Do the proper memory clean up. by first calling release function or delete operator then assign the object with nil.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜