I have a simple calculator that works, but my problem is if the user doesn't input any data into the fields then it still calculates. I thought I could do the following:
if (txtUserName.text == nil || txtUserName2.text == nil || txtUserName3.text == nil || txtUserName4.text == nil || txtUserName5.text == nil)
{
//error message
lblUserTypedName.text =@"Error - No Field Input";
}
else
{
lblUserTypedName.text = [[NSString alloc] initWithFormat: @"%2.1f%%", ultimate_risk];
}
But it's not working at all. Any help letting me know what I am missing here would be greatly appreciated. I would like to use the || so even if they input all fields except one this will still catch it.