Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a UIActionSheet from an NSArray
self.myActionSheet = [[UIActionSheet alloc] initWithTitle:@"Select Something" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil, nil];
//self.myArray could be an array of CoreData objects
for (id myObject in self.myArray) {
[self.myActionSheet addButtonWithTitle:myObject.aString];
}
[self.myActionSheet addButtonWithTitle:@"Cancel"];
self.myActionSheet.cancelButtonIndex = [self.myActionSheet count];
[self.myActionSheet showInView:[self.view superview]];
self.myActionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.