Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Dylan Aresu
9,687 Pointshow do i pass in a value to this method?
i want to be able to pass index values to the shipmovement method so i can access different ships from my iboutlet collection of ships on my viewcontroller... however it wont let me set index values inside this timer function, any ideas on how to fix this?
@implementation GameLevel4 -(void)viewDidLoad { [super viewDidLoad]; score = 17; goingRight = 0; shipTimer1 = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(shipMovement1:6) userInfo:nil repeats:YES];
}
-(void)shipMovement1:(int)index