Skip to content

Instantly share code, notes, and snippets.

@jeena
Created July 14, 2010 18:59
Show Gist options
  • Save jeena/475862 to your computer and use it in GitHub Desktop.
Save jeena/475862 to your computer and use it in GitHub Desktop.
- (void)openMoreAfterDelay:(id)sender {
UIMenuController *menuController = [UIMenuController sharedMenuController];
[self becomeFirstResponder];
NSMutableArray *menuItems = [[NSMutableArray alloc] initWithCapacity:5];
UIMenuItem *item;
NSInteger i = 0;
for (SquaceMLAction *action in [[dataSource.squaceML.squaregrid.squares objectAtIndex:activeIndex] actions]) {
item = [[UIMenuItem alloc] initWithTitle:action.text action:NSSelectorFromString([NSString stringWithFormat:@"action%i:", i++])];
[menuItems addObject:item];
[item release];
}
menuController.menuItems = menuItems;
[menuItems release];
[menuController update];
[menuController setMenuVisible:YES animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment