IPhone and iPad - including the class will increase the binary file?

I have a custom class that I often use in my projects. This class has several methods, but not all of them are used in each project.

My question is: inclusion of this class in the project will inflate the project with useless code or will the compiler simply include the methods used?

I mean, if my class has 30 methods, but only 4 are used in this project, will the compiler include other unused 26 or only 4 used in the final product?

If it includes everything, is there a way to make it ignore unused methods and trim the binary to a minimum?

+3
source share
4

dead-stripping, , .

Apple docs:

(ld) . ( ) , , , . undefined ( ).

. , . , , .

, .

+4

26 @implementation, , .

. 26 , , ( NSSelectorFromString -performSelector:).

, . (-dead_strip .)

+4

, -.

+2

: ?

, . . jessecurry, . , - api ( , , iphone, ). , , .

The most influential in terms of size is usually the resources that you include in your application (images, lines, etc.).

+1
source

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


All Articles