I have a iOS
app with a few simple and logical if-statements
. However they wont run and I can't understnad why. Here is my simple code:
-(void)viewDidLoad {
[super viewDidLoad];
// Run setup code.
int day = [self currentDay];
if ((day == (1 || 3 || 7) && (day != (2 || 4 || 5 || 6))) {
// Run the calendar setup code for
// Sunday/Tuesday OR saturday.
[self runSetupVX_4];
}
else if ((day == (2 || 4 || 5 || 6)) && (day != (1 || 3 || 7))) {
// Run setup code for Monday
// wednesday, thursday and friday.
[self runSetupVX_2];
}
}
-(int)currentDay {
NSDateComponents *component = [[NSCalendar currentCalendar] components:NSCalendarUnitWeekday fromDate:[NSDate date]];
return [component weekday];
}
What am I doing wrong here?