views:

41

answers:

1

Hi all,

I am trying to figure out if there is a way to implement an autocomplete functionality in a UITextField for specific values.

I know that the UITextField can do this using the iPhone dictionary (much like searching google in safari, etc), but I want to be able to programmatically have it correct to certain values that I specify.

Does anyone know of any way to do this?

Many thanks, Brett

A: 

Yes it is possible by using these functions.... It may satisfy ur needs

  • (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { temp=[NSString stringWithFormat:@"%@",string]; }

  • (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if ([elementName isEqualToString:@"cuisine"]) { textField.text=temp; } if ([elementName isEqualToString:@"cuisine"]) { [self.autocompletetextField addObject:temp]; } }

Chinju