In my opinion, better option is to check that way:
if (buttonIndex != alertView.cancelButtonIndex)