Split Objective-C Code into multiple files

后端 未结 7 1688
猫巷女王i
猫巷女王i 2020-12-05 12:19

I often feel the need to split the Objective-C code into multiple files for better readability. I want to avoid making classes and call them. I want simple import (like in p

7条回答
  •  温柔的废话
    2020-12-05 12:38

    This is a good indication that your class is just too large.

    One approach: Use categories. Declarations can often stay in the header. Then your implementations may be divided. Just make sure to specify the category you are implementing, so the compiler may match it with its declaration, and inform you when you miss a definition.

提交回复
热议问题