Skip to content

Bug: addButtonWithTitle fails when 0 buttons passed in initWithTitle#16

Open
simonholroyd wants to merge 1 commit intotwotoasters:masterfrom
simonholroyd:addButtonWithTitle_bugfix
Open

Bug: addButtonWithTitle fails when 0 buttons passed in initWithTitle#16
simonholroyd wants to merge 1 commit intotwotoasters:masterfrom
simonholroyd:addButtonWithTitle_bugfix

Conversation

@simonholroyd
Copy link

If you use addButtonWithTitle to add additional buttons rather than pass them all through initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles then the indexing of the buttons is incorrect. Maybe addButtonWithTitle wasn't designed to be a public method used this way, but I've found it's helpful sometimes to iteratively add buttons.

eg.

TTAlertView *alert = [[TTAlertView alloc] initWithTitle:@"test" message:@"testing alert" delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:nil];

...

[alert addButtonWithTitle:@"button that should show"];
[alert show];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant