根据输入的textField首字符排序

来源:互联网 发布:淘宝客微信群封号 编辑:程序博客网 时间:2024/06/05 04:00


textfield的值发生改变时.调用方法筛选
    [[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(search:)name:UITextFieldTextDidChangeNotificationobject:nil];

}

-(
void)search:(NSNotification*)notification{

   
NSString*str = [NSStringstringWithFormat:@"SELF like [c] '*%@*'",_tf.text];
   
   
NSPredicate*predicate = [NSPredicatepredicateWithFormat:str];
   
   
_dataAarray = [_dataArray1filteredArrayUsingPredicate:predicate];
   
    [
_collectionreloadData];


//label内容自适应

 _label.contentMode=UIViewContentModeScaleAspectFit

获得导航栏上按钮的视图
    UIView*v = self.navigationItem.rightBarButtonItem.customView;

0 0
原创粉丝点击