你好朋友在我的一项活动中,我创建了自定义文本字段,并且我有一个包含 50 条记录的数组,并为加载数组记录创建了自定义表....现在我想要当我们输入文本字段时,我的数组记录应该被过滤和在表格视图中获取欲望记录...
UITextField *patientname=[[UITextField alloc]initWithFrame:CGRectMake(130,10,170,30)];
patientname.font = [UIFont boldSystemFontOfSize:15.0];
patientname.tag=1;
//the horizontal alignment of the text
patientname.textAlignment = NSTextAlignmentLeft;
patientname.borderStyle = UITextBorderStyleBezel;
patientname.contentVerticalAlignment = UIControlContentHorizontalAlignmentCenter;
patientname.clearButtonMode = UITextFieldViewModeWhileEditing;
patientname.delegate =self;
[Self.view addSubview:patientname];
这是我的数组...
Array Name (
"Mr. Ram Singh",
"Mr. ",
"Master DSHKJLKD null mfkmlkdfsg",
"Mr. Rajat Jain",
"Mrs. Sonali K Singh",
"Mr. Amit Singh",
"Mr. Paan Singh",
"Mr. Ajit Singh",
"Dr. Rohan Sharma",
"Mr. Arpita Tripathi",
"Mr. Jacky Chain",
"Ms. Malini Ramani",
"Mr. Ankit Chavan",
"Mr. Ankit Gupta",
"Ms. Ragini Khanna",
"Mr. Raj Kumar",
"Mr. Manish gupta",
"Mr. Anshul Aggarwal",
"Ms. Priya Ranjith",
"Mr. Sdf Sdf Sdf",
"Mr. Sanyam Jain",
"Mr. Rakesh Gupta",
"Mr. Vishnu Gupta",
"Mr. Shabbir K Malik",
"Mr. mohan gupta",
"Mr. Sajat Jain",
"Mr. ",
"Mr. ravi kapoor",
"Miss Mona Hdjdbshs",
"Mr. test new demo",
"Mr. Devdas Gupta",
"Mr. Tarun Malik",
"Mr. Mayank Sharma",
"Miss Rachits Guptas",
"Mr. Test T Patient",
"Mr. Manish Kumar",
"Mr. Asd Asd Asd",
"Mr. NARENDRA Garg",
"Mr. ritik gupta",
"Mr. Mohd Salim",
"Mr. Anshul Garg",
"Ms. tanvi anand",
"Mr. ashish singh",
"Mr. Navdeep Bora",
"Mr. Rajat Kumar",
"Mr. shardul negi",
"Mr. Shrey Bhalla",
"Mr. ",
"Mr. Dushyant Sharma",
"Mr. Ritesh Kapoor",
"Mr. Jamna Das",
"Mr. hello patient",
"Mr. Ashish Vashisht",
"Ms. Prachi Pant",
"Mr. ",
"Mr. Sunil Kumar Singh",
"Mr. Mohd Ali",
"Mr. Jay Singh",
"Mr. Pantient Patient",
"Mr. paitent demo",
"Mr. adi df",
"Mr. Anamika Gupta",
"Mr. Subh Karmakar",
"Mrs. Kirshna Kumar",
"Mr. Jay Kishan",
"Mr. Ram Singh",
"Mr. Jagjeet Singh",
"Mr. Badal Yadav",
"Mr. Isha Bhalla",
"Mr. Saadhna Gupta",
"Mr. Tar Un",
"Mr. SR Khan",
"Mr. amar nath",
"Mr. ankur kaul",
"Mr. Qwe Qwe Qwe",
"Ms. Fgh Fgh Fgh",
"Mr. Kishan Lal",
"Mrs. Kkkk Kkk Kkk",
"Mr. radha gupta",
"Mrs. Meena Sharma",
"Mr. Charu Jain",
"Mr. dsf df",
"Mr. Testdemo Demotest",
"Mr. ",
"Mr. ",
"Mr. Yogendra Singh",
"Mr. ",
"Mr. rachit Gupta",
"Mr. Raman Malhotra",
"Mr. American Jain",
"Mr. aakash gandhi",
"Mr. Mohd Ali",
"Mr. ",
"Mr. Arpit Gupta",
"Mr. nitish Kumar",
"Mr. Drupad Jain",
"Mr. Ashish Moza",
"Mr. Rajat Jain",
"Mr. Shan Kumar",
"Mrs. Mahinder Kapoor",
"Mr. ",
"Ms. megha priya",
"Ms. lata gupta",
"Mr. Test Patientb",
"Dr. Himanshu Kumar Parashar",
"Mr. Gfh Gfh",
"Mr. ",
"Mr. ZX Zxc",
"Ms. manvi mehra",
"Mr. ramesh Babu",
"Mr. Dushyant Kumar Sharma",
"Mr. Asd Asd Asd",
"Mr. Rachit Gupta",
"Mr. Sachin Kumar",
"Mr. Rakesh Sharma",
"Mr. ",
"Mr. Amit Kumar",
"Mr. Ram Kumar Naresh",
"Mr. ",
"Mr. John Kumar Cena",
"Mr. sahd df",
"Mr. Asdfasd Asf Qweqwe",
"Mr. Sanjeev Kumar",
"Mr. Geeta Sharma",
"Mr. Ram Kumar",
"Mr. Sunil Rai",
"Mr. atul gupta",
"Mr. ",
"Mr. martin luther",
"Mr. Asd Qwe Qwe",
"Mr. Test Kumar",
"Mr. Shrey Bhalla",
"Miss Neha Jain",
"Ms. Anushka Sharma",
"Miss Jaysheer Jain",
"Mr. Fhdf Bgjgh ",
"Mr. Deepak Gupta",
"Mr. Test Patienta",
"Mr. Subh Karmakar",
"Mr. Mohan Kumar",
"Mr. apoorv sharma",
"Mr. ankit rathor",
"Mr. tarun gupta",
"Mr. Mohd Rizwan",
"Mr. hello sd",
"Mr. Amit Gupta",
"Mr. Dushyant 2nd Sharma",
"Mr. anshul aggarwal",
"Mr. Asd Asd Asd",
"Mr. Jitesh Kumar",
"Mr. Hodor Hodor Hodor",
"Mr. Abhinav Goel",
"Mr. Testz Z Patietn",
"Mr. Mohit Dani",
"Mr. ",
"Mr. Jinender Jain",
"Mr. aditya rai",
"Mr. Ankit Kjhk Loonia",
"Master Himanshu Kumar",
"Mr. mohan bhargav",
"Mr. Mohan Kumar",
"Mr. Satypal Kapoor",
"Mr. Mohit Raina",
"Mr. Asd Qwe Qwe",
"Mr. test test",
"Mr. Garima Gupta",
"Mr. Mayank Jain",
"Mr. Test C"
) 此数据加载到自定义表中,如 ....
table_SearchPatient=[[UITableView alloc]initWithFrame:CGRectMake(130,40,170,250)style:UITableViewStylePlain];
table_SearchPatient.delegate=self;
table_SearchPatient.dataSource=self;
table_SearchPatient.layer.borderWidth = 2.0;
table_SearchPatient.layer.borderColor = [UIColor grayColor].CGColor;
[self.view addSubview:table_SearchPatient];
该表成功加载所有数据以及如何使用自定义文本字段搜索所需名称..请解决问题..