Misleading MBLANCS documentation

I was under the impression that multiple calls to -[MBLANCS eventWithCategoryIds:identifier:] with the same identifier should return the same event. However, when I make this call twice (once to start logging and once to stop logging), I get a warning about unbalanced logging calls. 

When I call to -[MBLANCS eventWithCategoryIds:identifier:] once and save the result, I can start and stop logging as expected.

Is this the correct behavior? The documentation makes no mention of the need to save the event in memory. If iOS kills my app (and thus removes the event object from memory), how am I supposed to stop logging on my MetaWear?

Comments

  • Each call to -[MBLANCS eventWithCategoryIds:identifier:] will in-fact create a new MBLEvent.

    After you initially create an MBLEvent, you should use -[MBLMetaWear retrieveEventWithIdentifier:] to recover it.

    The MetaWear API will persist MBLMetaWear state on disconnect, so if you call disconnectWithHandler:, then next time you connect (even if the app is killed) your custom event will be restored and can be retrieved using -[MBLMetaWear retrieveEventWithIdentifier:] 

This discussion has been closed.