Imagine I implement a function that calls a subfunction. Keeping the subfunction in the .m
file keeps things more compact, so I'd like to do that. However, for debugging purposes, I need to call that subfunction. I try to do that, and I get File not found
, or a similar error. Is there a way to call a subfunction that is in the same .m
file as another function from outside that function?
There's no way around this. If you want to call a function from the command prompt or from multiple .m files you must put it into a separate .m file.
The only possible alternative is to have a class with multiple public methods.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.