Not returning from an instancetype method is undefined behaviour, and in this instance it's returning a garbage pointer, resulting in "does not respond to selector" errors on random objects, and causing a crash. -Wswitch does not raise a warning because the all the possible values of the enum are handled.
The solution is to explicitly return nil if no match is found, and bail out if the return value of +LFXGatewayConnection gatewayConnectionWithGatewayDescriptor returns nil.
Not returning from an
instancetype
method is undefined behaviour, and in this instance it's returning a garbage pointer, resulting in "does not respond to selector" errors on random objects, and causing a crash.-Wswitch
does not raise a warning because the all the possible values of the enum are handled.The solution is to explicitly return
nil
if no match is found, and bail out if the return value of+LFXGatewayConnection gatewayConnectionWithGatewayDescriptor
returns nil.Closes #24.