hanumanDev
hanumanDev

Reputation: 6614

How to remove Incompatible pointer to integer conversion in an animation block warning

I'm getting a "Incompatible pointer to integer conversion" in an animation block and am unsure how to get rid of it.

here's the code where it appears and a screenshot below:

 [UIView animateWithDuration:0.3f
                              delay:0.0f
                            options:nil
                         animations:^{
                             [menuView setFrame:CGRectMake(0.0f, 64.0f, 320.0f, 54.0f)];
                             menuView.alpha = 1.0;
                         }
                         completion:nil];

enter image description here

thanks for any help

Upvotes: 1

Views: 314

Answers (2)

markhunte
markhunte

Reputation: 6932

You should read the docs. Normally they will tell you what something will accept.

It looks like in this case you have to use a Constant.

For example:

[UIView animateWithDuration:0.3f
                              delay:0.0f
                            options:UIViewAnimationOptionTransitionNone
                         animations:^{
                             [menuView setFrame:CGRectMake(0.0f, 64.0f, 320.0f, 54.0f)];
                             menuView.alpha = 1.0;
                         }
                         completion:NULL;

Upvotes: 3

Jonathan Grynspan
Jonathan Grynspan

Reputation: 43472

The options parameter is not an object or pointer type, so of course you'll get this. It's an enumeration type, which is an alias of an appropriate integral type (i.e. int.) To pass no options, pass 0 or kNilOptions.

Upvotes: 5

Related Questions