Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Member access into incomplete type 'CALayer'

For the code below :

CGRect frame = CGRectMake(0, 0, cellWidth, 240);
MKMapView *mapView = [[MKMapView alloc] initWithFrame:frame];

mapView.layer.masksToBounds = YES;     
mapView.layer.cornerRadius = 10.0;

I included MapKit,QuartzCore and CoreLocation Frameworks in addition. For the last 2 lines, I am getting error : "Member access into incomplete type 'CALayer'"

Please tell me why I get this error and how to resolve this

EDIT: I got this error as I did not import Quartz.h, but i still dont understand why its saying incompleteness of CALayer type. Can anyone throw some light into depth of this.

Thanks

like image 974
Anil Kumar Avatar asked Dec 12 '25 08:12

Anil Kumar


2 Answers

Did you: #import <QuartzCore/QuartzCore.h>?

like image 159
Rui Peres Avatar answered Dec 14 '25 05:12

Rui Peres


You should import QuartzCore/QuartzCore.h framework in your particular class or file. I think you are not importing this framework in your particular file.

like image 28
Dharmbir Singh Avatar answered Dec 14 '25 05:12

Dharmbir Singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!