I want to pass some data to the fire method.So I use the 'userInfo'
I did like this:
struct MyStruct* userinfo = malloc(sizeof(struct MyStruct));
userinfo->a = 1;
userinfo->b = 2;
NSTimer *myTimer = [NSTimer scheduledTimerWithInterval:0.05 target:self selector:@selector(myFireMethod:) userInfo:userinfo repeats:YES];
But the problem happened,the iOS app crashed when running the scheduledTimerWithInterval
method.
It must be something wrong with 'userinfo' .What's the probably mistake?