Skip to content

Instantly share code, notes, and snippets.

@tingham
Created May 2, 2010 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tingham/386845 to your computer and use it in GitHub Desktop.
Save tingham/386845 to your computer and use it in GitHub Desktop.
- (CPToolbarItem)toolbar:(CPToolbar)toolbar itemForItemIdentifier:(CPString)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag{
if( [itemIdentifier isEqualToString:@"search"] ){
var searchItem = [[CPToolbarItem alloc] initWithItemIdentifier:itemIdentifier];
var searchField = [[CPSearchField alloc] initWithFrame:CGRectMake(0,0,180.0,22.0)];
[searchItem setView:searchField];
[searchItem setLabel:@"Search"];
return searchItem;
}
var tbItem = [[CPToolbarItem alloc] init];
[tbItem setLabel:itemIdentifier];
return tbItem;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment