How to create global functions in Objective-C

前端 未结 5 1658
攒了一身酷
攒了一身酷 2020-11-30 02:03

I\'m developing an iphone app and I need to have some functions to use globally in my classes.

But how can I do this?

I just tried to create functions.

5条回答
  •  感情败类
    2020-11-30 02:31

    Try to rename functions.m into functions.c.

    Or add this methods into some class SharedClass and decline them as static : + (void)prinTest. Then you can access them using this code

    [SharedClass printTest];
    

提交回复
热议问题