Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collection element of type 'double' is not an Objective-C object

The inY property gives an error. What is the correct syntax?

UIButton *optionButton = [UIButton buttonWithType:UIButtonTypeCustom];
NSObject* anim = @{@"target": target, @"inY": infoView.frame.size.height-100, @"outY": @800};

Tried creating a variable with it as done with optionButton but it doesn't seem to work. I presume I need to cast it as something the collection can understand.

like image 692
springbo Avatar asked Mar 31 '14 09:03

springbo


1 Answers

infoView.frame.size.height-100 is a float. You can't cast it, you need to box it in an NSNumber (similar to what you've done with the 800 value for outY):

@(infoView.frame.size.height-100)
like image 163
Wain Avatar answered Sep 29 '22 22:09

Wain