Hi , i would like to include a normal conventiional function in to my obcetive c project. I have tried putting the body of the function outside the implementation section , inside the @implemenation section. I know it wont be part of the class i'm defining , but do i have to declare it somewhere in aheader file. i just get build errors

An example(or link to a an example) would be brilliant .

i just dont know how you do it???.please help !!

I had not done this exactly but decided to try. I have an objective-c class for a program, dataparsing.m/h. I placed in it's .h file at the very bottom, below @end

void printInCOut(char *p);

At the tomp of the .m file above the @implementation line but below the import lines, I wrote out the function as:

void printInCOut(char *p)
{
NSLog(@"%s",p);

}

From within the dataparsing implmentation i called my c-style function with:

printInCOut("in here using a c style print");

It worked when i ran in the emulator that i saw in the XCode console the phrase "in here using a c style print" each time the method from my implemenation called it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.