tags:

views:

116

answers:

1

Hi,

When text is selected in the iPhone OS, the user is given the option to copy/cut etc. How would I go about adding a new option here?

An example of this is in CourseNotes for iPad http://www.youtube.com/watch?v=VLQhKkgco_I where the option is used to look up on wikipedia (around 55seconds in).

Thanks

+2  A: 

This is currently an iPhone OS 3.2 only option (thus making it an iPad-only option). If you are developing for the iPad, then you can set your own options by using the menuItems property:

UIMenuItem *menuItem = [[UIMenuItem alloc] initWithTitle:@"MyOption" action:@selector(myAction)];
[[UIMenuController sharedMenuController] setMenuItems:[NSArray arrayWithObject:menuItem]];
[menuItem release];
glorifiedHacker
Thank you. Just what I was after. Is there a way to pass the selected text to the selector method?
Jack