Handler functions take 10 seconds before calling the handler?
Hi there,
I'm trying out some of the functionality on my MetaWear board.
Blinking the LED in different colors and stopping the blinking is working fine.
Reading the temperature or battery state, or also the button pressed state works, but from the moment I call the function, it will take about 10 seconds for the callback function on my iPhone to show my alert.
For example, I call
[device readBatteryLifeWithHandler:^(NSNumber *number, NSError *error) {
alert(@Battery %, [number stringValue]);
}];
This will take 10 seconds, and then an alert is shown on my iPhone.
alert is a function I made as follows:
void alert(NSString *sTitle, NSString *sMessage)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:sTitle
message:sMessage
delegate:nil
cancelButtonTitle:@OK
otherButtonTitles:nil];
[alert show];
[alert release];
}
Any ideas on how I can speed this up?
Thanks!
This discussion has been closed.
Comments