You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I may be misunderstanding something but I couldn't get your heartrate example to work without some modifications.
In ScanListViewController.m, when I was looking for my heartrate sensor, I would get the following error in viewWillAppear:
2017-04-07 17:01:28.751428 RZBluetoothExample[286:10774] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete row 0 from section 0 which only contains 0 rows before the update'
The first issue (i think) was that scannedDevices wasn't getting populated with anything from scanInfo, so I added the line:
This was then correctly populating devices into scannedDevices but they weren't being shown (still the same error above) until I rewrote the populating of the list like this:
Hello. I may be misunderstanding something but I couldn't get your heartrate example to work without some modifications.
In ScanListViewController.m, when I was looking for my heartrate sensor, I would get the following error in viewWillAppear:
2017-04-07 17:01:28.751428 RZBluetoothExample[286:10774] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to delete row 0 from section 0 which only contains 0 rows before the update'
The first issue (i think) was that scannedDevices wasn't getting populated with anything from scanInfo, so I added the line:
[self.scannedDevices addObject:scanInfo];
just after
This was then correctly populating devices into scannedDevices but they weren't being shown (still the same error above) until I rewrote the populating of the list like this:
instead of:
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:existingIndex inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
I know that this isn't as elegant, but it worked and I now get heartrate data. The full method is this:
However, did I do something wrong with your code, or is there a more elegant way of achieving what I "fixed"?
I have a follow-on question which I will post in a second thread.
Thanks
The text was updated successfully, but these errors were encountered: