objective c - How to show filtered table view in iOS? -
i have 2 tableview
s @ moment.
1 basic tableview
shows cells , if selected, goes detailed viewcontroller
.
i created new viewcontroller
create filtered
page view. populate page view plist. managed create filter don't know how proceed here.
this have:
- (ibaction)ingredientsaddbutton:(uibutton *)sender { int j=0; onemsiz.text=ingredienttextfield.text; ingredienttext=onemsiz.text; nslog(ingredienttext); nsstring *path = [[nsbundle mainbundle] pathforresource:@"recipes" oftype:@"plist"]; nsarray *arrayofplist = [[nsarray alloc] initwithcontentsoffile:path]; if (arrayofplist==null) { }else { (int i=0; i<4; i++) { // have 4 element plist. nsstring *strcurrentrecipeingredients = [[arrayofplist objectatindex:i] objectforkey:@"recipeingredients"]; nsstring *strcurrentrecipename = [[arrayofplist objectatindex:i] objectforkey:@"recipename"]; //nslog(@"%d. loop \n", i+1); if([strcurrentrecipeingredients rangeofstring:(@"%@",ingredienttext)].location!=nsnotfound) { nslog(@"%@ contains %@ ",strcurrentrecipename, ingredienttext); nslog(ingredienttext); nslog(strcurrentrecipeingredients); j++; }else { nslog(@"not found"); nslog(ingredienttext); nslog(strcurrentrecipeingredients); } if (ingredienttext==null) { nslog(@"empty input"); }else { } } } nslog(@"%d",j); }
my first problem how can show results in tableview
?
you create table view , create , assign data source , delegate. if data in 1 of table view needs changed when displayed, easy way force update call [tableview reloaddata];
Comments
Post a Comment