Ok here is an interesting one… I am receiving the
warning: Characters may not respond to 'addHeroType:atX:atY:fromMobTable'
although I have the functions defined properly as far as I can see so how about another pair of eyes?
Here is the definition in Characters.h
-(void) addHeroType:(int)newMobType atX:(int)x atY:(int)y fromMobTable:(Mobdefs*)newMobTable;
Here is the function in the Characters.m
-(void) addHeroType:(int)newMobType atX:(int)x atY:(int)y fromMobTable:(Mobdefs*)newMobTable
and here is the call I am making in another class call heroFactory (Characters.h is included in heroFactory):
[Characters addHeroType:1 atX:location.x atY:location.y fromMobTable:newMobTable];
But this line causes the app to terminate due to uncaught exception – checking the debugger I see “NSObject Does Not Recognize Selector”
I am convinced that the issue is the wierdness of why I am seeing a warning that the Character class may not respond to the function call as written even though it matches identically to the definition.
Any help greatly appreciated.
That is declared as an instance method.
But you are calling it on the class as a class method.
So either, declare the method as a class method
Or call it on an instance
Depending on the scope your method requires, of course.