How can i write a global method that can be called anywhere in my iPhone App Can any one Help Please.... Thanx and regards Balu.....
views:
58answers:
2
A:
You would normally use the Singleton Class to contain global data and methods for your iphone application. Here are 2 good references: Singleton Tutorial, Singleton Pattern
ennuikiller
2010-06-29 07:45:41
+2
A:
You can write global functions (not part of a class) wherever you like. Just add the declaration where you use it (i.e. include a header file).
For example:
File globalfunctions.h
void doCoolStuff();
File globalfunctions.c
#include "globalfunctions.h"
void doCoolStuff()
{
}
and where you use it use
#include "globalfunctions.h" // or
#import "globalfunctions.h"
Eiko
2010-06-29 07:51:16