user1175380
user1175380

Reputation: 87

Xcode Instance method not found

sometimes I get the Warning for example :

Instance method '-PushBottom' not found (return type defaults to 'id')

because the function PushBottom is under this function (where it called) declared.

For fixing this warning I put the function PushBottom about this function (where it called).

Is there any way to get fix this warning without put function PushBottom about the function where it called?

Upvotes: 1

Views: 5951

Answers (2)

GWed
GWed

Reputation: 15653

I would define it in your .m file (the .h file is your public api file and unless you want it to be public, I wouldnt put it in there as suggested in another answer).

Above the @implementation In your .m file write:

@interface yourClassName()
-(void)yourMethod;

@end

Upvotes: 2

glogic
glogic

Reputation: 4092

you could declare the push button in the .h file

-(void)PushButton;

or -(IBAction)PushButton:(id)sender;

depending on what the function is. just declare it in the .h file above the @end and u should be good to go

Upvotes: 3

Related Questions