¡@

Home 

2014/10/15 ¤U¤È 10:12:55

iphone Programming Glossary: printtest

How to create global functions in Objective-C

http://stackoverflow.com/questions/7294176/how-to-create-global-functions-in-objective-c

my classes. But how can I do this I just tried to create functions.h likes this #include Foundation Foundation.h void printTest and in the functions.m #import functions.h void prinTest NSLog @ test but it doesn't work. Says me Method definition not.. is create a class method in a static class Header #import Foundation Foundation.h @interface GlobalStuff NSObject void printTest @end Implementation #import functions.h @implementation GlobalStuff void printTest NSLog @ test Call using #import functions.h.. GlobalStuff NSObject void printTest @end Implementation #import functions.h @implementation GlobalStuff void printTest NSLog @ test Call using #import functions.h ... GlobalStuff printTest The other option is to declare a global function instead..