I have a big class. To sum up, it has only one method that other classes should call and then a bunch of methods to do different stuff, depending on the type of data received. The .m file is getting so large that I want to split it up. My idea is to divide the methods among different categories (each category will work with a specific type of data). And so I did.
Inside of the main method I didn’t change anything, so lines such as
[self methodNowInMyCategory];
are still there. However, I now get warnings in my class’s main file since “instance method -methodNowInMyCatefory not found”. The main .h file is importing the .h files of the categories, so the methods are visible (Xcode colors the code). The class just does not recognize them as its own.
Is there a way to, in a class, use a method declared in one of its categories? If not, which approach would you recommend me to solve my problem? The main method receives a file path, opens the file, analyzes the content and then sends it one or more methods.
You can split your category declarations into one or more .h files, and then import the category headers in your class’s main .m.