for some reason I get an error here
#import "OtherViewController.h"
@interface ViewController: UIViewController
@property (nonatomic, strong) OtherViewController *otherViewController;
this gives me an error saying ‘unknown type name OtherViewController’ why is this happening to me? Is this not the way to send messages to other view controllers. If so what is the way you are supposed to do this?
From what you have posted, there isn’t anything wrong with what you have posted. That being said, you don’t need to declare a property for the other VC. What you need to do is declare a public property on OtherViewController (like an NSString) and then you can access that property from the ViewController class. Something like (assuming you are using Storyboards):