Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CGFloat is showing an error

I have declared a CGFloat variable on my header file:

@property (nonatomic)CGFloat *heightOfSection;

Synthetized it on my implementation file, but it gives me an error trying to assign a value to it:

// Set height of section
            heightOfSection = 45.0f;

This is the error shown:

Assigning to 'CGFloat *' (aka 'float *') from incompatible type 'float'

Any idea to solve the issue?

like image 592
mvasco Avatar asked Jan 22 '14 19:01

mvasco


1 Answers

CGFloat is a primitive type, not an object type. Your property should be declared like this:

@property (nonatomic) CGFloat heightOfSection;
like image 87
rmaddy Avatar answered Sep 20 '22 21:09

rmaddy