I’m trying to call a method of the below (Scroll animation class) type from a viewcontroller class.
-(void)CreateLabel:(CGRect )frame andLabel:(UILabel *[NUM_LABELS])label andview:(UIView *)view;
I got some errors when I tried passing the argument. Any suggestion on how to call this?
This is how I called that method
ScrollAnimation *newAnimation = [[ScrollAnimation alloc] init];
[newAnimation CreateLabel:CGRectMake(0, 50, 300,30) andLabel:animateLabel[NUM_LABELS] andview:self.view];
I have the error
/Volumes/Red Drive/CarTransition/CarTransition/ViewController.m:120:66: Implicit conversion of an Objective-C pointer to 'UILabel **' is disallowed with ARC
/Volumes/Red Drive/CarTransition/CarTransition/ViewController.m:120:66: Incompatible pointer types sending 'UILabel *__strong' to parameter of type 'UILabel **'
Create Label Method :
-(void)CreateLabel:(CGRect )frame andLabel:(UILabel *[NUM_LABELS])label andview:(UIView *)view{
for (int i = 0; i<NUM_LABELS ; i++){
if(i == 0){
label[0] = [[UILabel alloc] initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width,frame.size.height)];
label[i].text = @"MINI ";
}else if(i == 1){
label[1] = [[UILabel alloc] initWithFrame:CGRectMake(frame.origin.x, frame.origin.y - 40 ,frame.size.width, frame.size.height)];
label[1].text = @"COOPER ";
}else if(i == 2){
label[2] = [[UILabel alloc] initWithFrame:CGRectMake(frame.origin.x, frame.origin.x-120 ,frame.size.width,frame.size.height)];
label[2].text = @"STYLING";
}
}
Your method is asking an array of pointer.
here’s a dirty example:
Now the call:
want