0

I'm trying to call a function called animateRight in a file called ScanAnimation.m from SecondViewController.m.

In the top of SecondViewController.m I have:

ScanAnimation * Animation = [[ScanAnimation alloc] init];

and I make the call with:

[Animation animateRight];

and I get the error:

'ScanAnimation' undeclared

What am I doing wrong?

1 Answer 1

1

You need to import the ScanAnimation header file into the file you are making the call in.

So in the SecondViewController.m you would add #import "ScanAnimation.h" at the top under #import "SecondViewController.h"

Sign up to request clarification or add additional context in comments.

1 Comment

Ok, you need to declare it in the header file for the ScanAnimation class. What you do is copy the -(void)animateRight part and put it in the header file like this. -(void)animateRight;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.