This is my first time working with Objective-C, and I keep trying to create objects of classes I have created in methods of other classes, and it will not work. What I mean is for instance, I will have one main class, and one of the methods does something like this:
exampleclass *instance1 = [[exampleclass alloc] init]
And it says that exampleclass is undeclared. exampleclass is in another file, and my main class can’t contact it, or at least that is what I think is happening. Why can’t it find exampleclass and create an instance of it?
Have you imported the header for this class in the source file where you are trying to use it? Add something like:
at the file top with the other header imports. That’s assuming that you named your files after your classes.