Receiving bundles
Is it possible to receive bundles?
I got an error, everytime I try to receive an osr message:
****Assertion failure in -[OSCDispatcher dispatchPacket:] ****Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to remove OSC method with invalid address pattern: nil
If its not possible, does anybody know where I can find Informations how to include this?
It's currently possible to send bundles but not receive them. Check out the "TODO" note in -[OSCDispatcher dispatchPacket:] here:
https://github.com/danieldickison/CocoaOSC/blob/master/CocoaOSC/OSCDispatcher.m#L216
I haven't been actively developing this library in a long time so I don't recall exactly what it would take to handle bundles correctly. I believe bundles are already successfully parsed into OSCMutableBundle instances (mostly; see below about the time tag). The exception arises when the dispatcher tries to dispatch the bundle to its address, but a bundle doesn't have a single address — instead it would need to iterate through its child packets to dispatch those.
(By the way, the assertion failure reason string is misleading — must've been a copy-and-paste job from the method above.)
The other, perhaps more complicated issue with bundles is that they can contain a "Time Tag", and its child messages must be dispatched according to the clock time represented by the time tag. OSCMutableBundle doesn't yet parse the time tag, so you'll need to add that, but more importantly you would need to implement some sort of scheduling system if you want to handle bundle time tags properly. In actually, with GCD I don't think this would be particularly difficult to do as long as you don't need very accurate timing.
I'll be happy to accept a pull request if you end up implementing it. It is a bit of a pain since the library uses manual reference counting (I think it originally predated ARC), but I haven't had time to update it in any significant way.