PS: I should mention that if I replace the message[0] = type with message[0] = 0x90, it works fine.
- (void) sendMessage:(int) type data:(char[]) data length:(int)length { ++length; char message[length]; message[0] = type;...
Separate names with a comma.