I have what I know is a simple question, but after many searches in books and on the Internet, I can\'t seem to come up with a solution. I have a standard iPhone project th
You should probably take a look at one of the many Objective C tutorials, but the direct answer to your question is that you have not allocated and initialised an instance of your object. The code should look like:
utils = [[Utils alloc] init];
[utils myMethod];
You just need to create the actual object.
Your implementation only defines a pointer to an Util
object but it still points to nil
.
utils = [[Util alloc] init];
An alternative is to create static methods by replacing -
by +
in the method prefix.
[Util myMethod];