Pass Pointer to First Packet Between Methods (Obj-C)
问题 I'm missing something here, but I'm not sure how to fix it. The first version of this works: - (void) sendBytes:(const UInt8*)bytes size:(UInt32)size { Byte packetBuffer[size+100]; MIDIPacketList *packetList = (MIDIPacketList*)packetBuffer; MIDIPacket *packet = MIDIPacketListInit(packetList); MIDIPacketListAdd(packetList, sizeof(packetBuffer), packet, 0, size, bytes); [self sendPacketList:packetList]; } For DRYness, I try to make a method out of the packet list creation: - (MIDIPacketList*)