Test memory management in Objective-C (iOS)

I'm a little new to Objective-C, and although I think I have a decent understanding of memory management, I would like to familiarize myself with the best ways to check this (if possible).

I know two options: 1) Build and analyze (from within Xcode) and 2) Tools.

Are they the best tools for the job? How accurate is the assembly and analysis function? I have not used the tools yet, but when I tried to get started, it looked a bit more complicated.

I understand that the best approach may be to learn Objective-C, but I am looking for additional ways to test this.

Thanks for any ideas.

+3
source share
5 answers

, , . , . , , Objective-C . , , , , - Objective-C , .

. , , . , . . . , , , , , . , . , ( , , , , ).

Guard Malloc , , iOS. , . , , C , , , , , , .

+2

, , " [ ]" .

; , , .

  • ; ,

  • ; # , / . - .

  • ; .

  • Heapshot, , .

  • , - / , .

+3

, , , http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/MemoryMgmt/MemoryMgmt.html

Build and Analyze , , - . , .

, , .

, , Run- > Stop On Objective C Exceptions. , , , .

+1

Objective-C ( Java), (Build/Analyze) . , , , Apple, , , , -.

, , . , .

, , , . ( ) , /init, . , alloc, , , .

The leak tool was very useful, but make sure you put your app through a call while it is running. Just click on all kinds of things, exit and exit the screen many times, click on things that people will never do, etc. You will find leaks. Then crush them. Very nice.

+1
source

Clang with xcode is another great option. http://clang-analyzer.llvm.org/xcode.html

0
source

Source: https://habr.com/ru/post/1788884/


All Articles