I'm developing for iOS 7 but I still have to manually write getters otherwise my properties just don't get initialized. I tried to manually synthesize those properties, even though that shouldn't be needed anymore, but that doesn't do it.
In my view controller below, I use the property motionTracker
, which never gets initialized. I have the same issue with all my projects, so I know it's a misunderstanding on my part.
#import "ViewController.h"
#import "TracksMotion.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIButton *startRecording;
@property (weak, nonatomic) IBOutlet UIButton *stopRecording;
@property (strong, nonatomic) TracksMotion *motionTracker;
@end
@implementation ViewController
@synthesize motionTracker = _motionTracker;
- (void)startMyMotionDetect
{
[self.motionTracker startsTrackingMotion];
}
@end
The motionTracker
has a public API for the method startsTrackingMotion
so I don't know why this doesn't work.
#import <Foundation/Foundation.h>
#import <CoreMotion/CoreMotion.h>
@interface TracksMotion : NSObject
- (void)startsTrackingMotion;
- (void)stopTrackingMotion;
@property (strong, nonatomic) CMMotionManager *motionManager;
@end