Я попробовал следующее:
Я ожидаю, что кнопка будет видимой или скрытой в зависимости от существования файла appCbPath
. _theUpdButton
- это кнопка в моем xib.
//but unfortunately this doesn't work
BOOL boolCBAppExist = [self fileExist:appCbPath]; //Which returns true or false
[_theUpdButton setHidden:!boolCBAppExist];
//but this works
if (!boolCBAppExist)
{
[_theUpdButton setHidden:TRUE];
}
else
{
[_theUpdButton setHidden:FALSE];
}
Не понимаю, почему первая попытка не работает.
Что я делаю не так?