Skip to content
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

Heart rate integration fails #3

Closed
ios-sagar opened this issue Sep 22, 2016 · 1 comment
Closed

Heart rate integration fails #3

ios-sagar opened this issue Sep 22, 2016 · 1 comment

Comments

@ios-sagar
Copy link

Hi,

I am new to this thing,
I get your library and checked the code.
It is written awesome.

I am facing issue to integrate into my code.
I am using Xcode 7.3 and checking on iOS 9.3

Here is my code...

in ViewController.h file

import <UIKit/UIKit.h>

import "HeartRateDetectionModel.h"

@interface ViewController : UIViewController
@Property (nonatomic, strong) HeartRateDetectionModel *hr;
@EnD

in ViewController.m file

import "ViewController.h"

import "HeartRateDetectionModel.h"

@interface ViewController ()

@EnD

@implementation ViewController

@synthesize hr;

  • (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    self.hr = [[HeartRateDetectionModel alloc] init];
    self.hr.delegate = self;
    [self.hr startDetection];
    }

  • (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    }

-(void)heartRateStart
{
NSLog(@"started!");
}

when I didn't wrote the method "heartRateStart" it was crashing saying "unrecognized selector sent to instance"

now if I do so,
It says
"-[ViewController heartRateUpdate:atTime:]: unrecognized selector sent to instance"

am I following correct guidelines for implementation.
Every time when I integrate your files in any app, do I need to declare all these delegates methods and call to them externally....?

@lehn0058
Copy link
Owner

Yes, you will need to implement the methods in the class you have assigned as the delegate. Implementing the heartRateUpdate method is what returns the updated heart rate to you.

On Sep 22, 2016, at 2:39 AM, Sagar C notifications@github.com wrote:

Hi,

I am new to this thing,
I get your library and checked the code.
It is written awesome.

I am facing issue to integrate into my code.
I am using Xcode 7.3 and checking on iOS 9.3

Here is my code...

in ViewController.h file

#import
#import "HeartRateDetectionModel.h"
@interface ViewController : UIViewController
@Property (nonatomic, strong) HeartRateDetectionModel *hr;
@EnD

in ViewController.m file

#import "ViewController.h"
#import "HeartRateDetectionModel.h"

@interface ViewController ()

@EnD

@implementation ViewController

@synthesize hr;

(void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

self.hr = [[HeartRateDetectionModel alloc] init];
self.hr.delegate = self;
[self.hr startDetection];
}

(void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

-(void)heartRateStart
{
NSLog(@"started!");
}

when I didn't wrote the method "heartRateStart" it was crashing saying "unrecognized selector sent to instance"

now if I do so,
It says
"-[ViewController heartRateUpdate:atTime:]: unrecognized selector sent to instance"

am I following correct guidelines for implementation.
Every time when I integrate your files in any app, do I need to declare all these delegates methods and call to them externally....?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@lehn0058 lehn0058 closed this as completed Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants