Reputation: 1287
So I'm trying to access the property isPortClosed(BOOL) in SerialPortController and its giving me an error, I'm kinda new to objective-c. I feel like this should work as I've got a reference to the class with *port. Here is a link to the project.
Error messages: ~/GroundStation/GroundStation/ViewController.m:16:22: Property 'isPortClosed' not found on object of type 'SerialPortController *'
#import <Cocoa/Cocoa.h>
#import "SceneView.h"
#import "SerialPortController.h"
@interface ViewController : NSViewController
@property (strong) IBOutlet SerialPortController *port;
@property (weak) IBOutlet SceneView *accelSceneView;
@end
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
while(!self.port.isPortClosed) {
}
}
- (void)setRepresentedObject:(id)representedObject {
[super setRepresentedObject:representedObject];
// Update the view, if already loaded.
}
@end
SerialPortController.h class
#import <Foundation/Foundation.h>
#import <ORSSerial/ORSSerial.h>
@interface SerialPortController : NSObject <ORSSerialPortDelegate>
@property (nonatomic, strong) ORSSerialPort *serial;
@property (nonatomic, strong) ORSSerialPortManager *serialPortManager;
@property (nonatomic) NSInteger xAngle;
@property (nonatomic) NSInteger yAngle;
@property (nonatomic) NSInteger zAngle;
@property (nonatomic) NSString *stringBuffer;
@property (nonatomic) BOOL isPortClosed;
@end
Upvotes: 1
Views: 1642
Reputation: 2660
From the downloaded project I see that you have two SerialPortController
class definitions (one at the root directory, and one in /GroundStation/), and the latter doesn't have any public properties. You should have only one SerialPortController
class definition linked in your project (the one with the public properties).
Upvotes: 2