初始值:self.conditionState = 5;
//1:收件人=1 10:发件人=2 100:标题=4 1000:内容=8
- (IBAction)checkedbox:(id)sender {
UIButton *button = (UIButton *)sender;
button.selected = !button.selected;
int tmp = 1;
// NSLog(@"%d",button.tag);
// NSLog(@"%d",self.conditionState);
tmp = tmp << button.tag;
// NSLog(@"tmp:%d",tmp);
if (button.selected) {
self.conditionState |= tmp;
}else{
self.conditionState &= ~tmp;
}
// NSLog(@"%d",self.conditionState);
}
//1:添加LIKE 操作 0:不添加LIKE操作
-(int) isAppendSQL:(int)num withState:(int)state
{
int tmp = 1;
tmp = tmp << num;
tmp &= state;
//NSLog(@"%d",tmp);
return tmp;
}