iOS - how do I create a "utility" class that all my controllers can call

Viewed 12962

I am new to iOS and obective-c so I am not too sure how to best accomplish this seemingly simple task.

What I want is to make a class that looks like this in pseudocode:

class UtilityClass
{
    // Have a method that I can pass parameters to 
    String doCalculation ( String art1 , String arg2 )
    {
        return arg1 + arg2;
    }
}

My uncertainty is:

1) xCode seems to be inclined to lay out my file structure in a relatively flat way. So should I make a utils directory and have this file be under utils/fileName ? Usually I am kind of used to having at least some src directory, but so far I have not been prompted by anything to create one. 2) How do I import and call this class/function from my controllers?

Thanks, Alex

3 Answers
Related