so i am trying to have a list of UIButtons in an Array be chosen randomly one at a time and everytime it chooses a button, it makes the buttons set hidden to NO, then moves the button from the point (240, 30) to the point (30, 240). I then want the button chosen and moved to automatically delete itself from the array with all the buttons. this way the second time this event is called the buttons already moved wouldn't be able to be chose. here's my code for now... i know im not that good
h. file
i didn't actually connect this UIButton to a round rect button in interface builder, im just attempting to createt a random uibutton that will be randomly selected and able to be called out by the universal name of "theButton"
m. file
all help is appreciated
h. file
Code:
UIButton *theButton;
@property (nonatomic, retain) IBOutlet UIButton *theButton;
i didn't actually connect this UIButton to a round rect button in interface builder, im just attempting to createt a random uibutton that will be randomly selected and able to be called out by the universal name of "theButton"
m. file
Code:
-(void)dealFirstCard{
theButton = [[entireCardDeckArray objectAtIndex: (random() % [entireCardDeckArray count])]setHidden:NO];
CGPoint faceCenter = theButton.center;
faceCenter.x = 40;
faceCenter.y = 195;
theButton.center = faceCenter;
[UIView beginAnimations:@"Card1DealAnimation" context:nil];
[UIView setAnimationDuration:1];
CGPoint center1 = cardDeck.center;
center1.x = 32;
center1.y = 420;
cardDeck.center = center1;
[UIView commitAnimations];
[entireCardDeckArray removeObject:theButton];
}
all help is appreciated