You should have just seen two alerts, but you will only see the second alert if this code is compiled to an iOS device.