ios - Syntax for "or" & "and" statements -


what proper syntax putting , & or statements?

i trying implement code validate data user inputting. have segmented control, text view , next page button. advance next view controller user must choose "yes" or "no" on segmented control , if yes selected must enter text text view.

- (ibaction)nextpagebutton:(uibarbuttonitem *)sender {  if (weatherdelaystring == nil || ([weatherdelaystring isequal: @"yes"] && weatherdelaytextview.text == nil)) {     nslog(@"nothing selected"); }else{     vc7signature *vc7 = [[vc7signature alloc]initwithnibname:nil bundle:nil]; [self presentviewcontroller:vc7 animated:yes completion:nil]; }} 

could clarify syntax required implement logic?

why not de-mangle / de-tangle code rid of of , & or cases. can 1 single and:

- (ibaction)nextpagebutton:(uibarbuttonitem *)sender {      if ([weatherdelaystring isequal: @"yes"] && ([weatherdelaytextview.text length] > 0))     {         vc7signature *vc7 = [[vc7signature alloc]initwithnibname:nil bundle:nil];         [self presentviewcontroller:vc7 animated:yes completion:nil];     } else {         nslog(@"the yes / next condition want users have go forward isn't selected");     } } 

which easier read or plus nested , conditional.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -