-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question from newbie #2
Comments
Did you get prompted for permission to use the camera? If permission is not given when the dialog is displayed, then the camera can't be used by the app. You can check the permissions under the settings app. |
Thanks for your quick answer. |
So tested on a fresh xcode installation, on a new git clone (+add previous code for viewController), on a new device with ios 9.2.
Settings privacy, camera enable for the project. tried with a device 7.1 (no cam permission), same result . I'm pretty sure the problem comes from my side, but cannot find where. Thank you in advance. |
I think I see your issue. HeartRateDetectionModel *hr is being released from memory right after you call start. You will need to keep an instance that stays around - probably as a property on the class your start method is in. Try something like this: // At top of class file
|
It was exactly that. |
Hi,
Thanks you for this great class.
But I'm a newbie and tried to use your lib today and result: camera flash start and stop directly on iphone 5c IOS 9.
Not sure what I did wrong.
My viewController.h:
import <UIKit/UIKit.h>
import "HeartRateDetectionModel.h"
@interface ViewController : UIViewController
@Property (weak, nonatomic) IBOutlet UILabel *label;
@EnD
and my viewController.m
import "ViewController.h"
import "HeartRateDetectionModel.h"
@interface ViewController ()
@EnD
@implementation ViewController
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
HeartRateDetectionModel *hr = [[HeartRateDetectionModel alloc]init];
hr.delegate = self;
[hr startDetection];
}
-(void)heartRateStart {
NSLog(@"started!");
self.label.text = @"started!";
}
-(void)heartRateEnd {
NSLog(@"Stopped!");
self.label.text = @"started!";
}
-(void)heartRateUpdate:(int)bpm atTime:(int)seconds {
NSLog(@"running!");
self.label.text = @"running!";
}@EnD
Like I said, still I newbie, any idea why flash just start and stop?
Thank you in advance for your help.
Dams
The text was updated successfully, but these errors were encountered: