Reputation: 15510
I am getting the Error/Warning about a part of my code saying 'Messages Without A Matching Method Signature will be assumed to return 'id' and accept '…' as arguments.)' I do not understand why I am getting this error, so i am looking for some help, below is a link to that part of code in the implementation file.
Here is the error.
alt text http://snapplr.com/snap/qw1r
Thanks :)
Upvotes: 1
Views: 2151
Reputation: 28600
From your code, it looks like you are accessing the objectArray property of self
. Do you have that defined in your .h file?
@interface DragController : UIViewController
{
NSArray* objectArray;
}
@property (nonatomic, retain) NSArray* objectArray;
If the @property
is not present, then your class does not respond to [self objectArray]
. You only need the property if you need other objects to access it. If you just want to access the instance variable, you can simply use objectArray
by itself, so replace [[self objectArray] indexOfObject...
with simply [objectArray indexOfObject...
and the warning should go away. If objectArray really is a method, it should look like this in your .h file, after the { instance variables }
section:
-(NSArray*)objectArray;
And in the .m file:
-(NSArray*)objectArray
{
// return the array here
}
Upvotes: 2
Reputation: 376
This warning usually means your signature may be different or you haven't declared a prototype for your method.
For instance, you may have done something like this:
// Prototype
-(void) foo:(float)bar;
// Calling the function
int blargh = 3;
[myClass bar:blargh];
You see how the signatures don't match? Usually, this is the problem when I get the warning. Though you may have neglected to prototype it at all, which results in the same problem. Objective-c will accept any messages you pass to an object, even if it technically wasn't specified by you.
Upvotes: 4