What is build object file extension in iOS?

后端 未结 3 559
故里飘歌
故里飘歌 2020-12-07 06:22

When I build java object class in a project, build file will be created with .class extension and human unreadable; What about swift build files?

example:

3条回答
  •  隐瞒了意图╮
    2020-12-07 06:37

    In iOS world every sources file - .m, .h, .swift are compiled into executable byte code that is understandable by CPU. These files are also called Mach object - ABI Mach-O (.o)[About] file with a meta-information.

    `*.swift` -> `*.o` (Mach-O object file).
    

    For example if you created a static library - myLibrary.a. You can use nm[About] command to display name list (symbol table).

    nm path/myLibrary.a
    

    As a result you will see a list of *.o files with methods, variables names etc.

    [Xcode build process]

提交回复
热议问题