我想顯示警報時,值是零,我有titleCategory如果有null值,那麼它應該自動顯示警告如何顯示警報時,值是空
NSString*test=titleCategory;
if ([titleCategory isEqualToString:nil])
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Select Category " delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
else
{
FirstViewController*targetController=[[FirstViewController alloc]init];
[self.navigationController pushViewController:targetController animated:YES];
}
變化'如果([titleCategory isEqualToSt如果([標題類別長度] = 0)' – iNoob 2012-08-07 08:38:11
iNoob感謝它的工作如果我有那裏的價值,我希望他們中的任何一個是長度然後顯示警報 – user1567956 2012-08-07 08:41:10
你在哪裏設置'titleCategory '變量? – rckoenes 2012-08-07 08:41:19