First time trying to use this popUpButton. I read through some documentation but I can't seem to figure out the code I need to add to give it a value. I use this code to populate the pull-down with a list of things. I have a variable set up so if they select d100 it should assign the integer value of 100 to the variable? I know it is in front of my eyes in the documentation but I can't find it.
I was thinking I could do something like this
But I im getting an error saying "Return type defaults to id". I am setting the "d100" and it works fine. Is it because I am trying to assign an integer to an object?
Code:
-(void)awakeFromNib
{
[sidedDiceSelection addItemWithTitle:@"d100"];
[sidedDiceSelection addItemWithTitle:@"d20"];
[sidedDiceSelection addItemWithTitle:@"d12"];
[sidedDiceSelection addItemWithTitle:@"d10"];
[sidedDiceSelection addItemWithTitle:@"d8"];
[sidedDiceSelection addItemWithTitle:@"d6"];
[sidedDiceSelection addItemWithTitle:@"d4"];
[sidedDiceSelection addItemWithTitle:@"d2 "];
}
I was thinking I could do something like this
Code:
[sidedDiceSelection addItemWithTitle:@"d100" setObjectValue:100];