Member access into incomplete type 'CALayer'

对着背影说爱祢 提交于 2021-01-27 11:52:26

问题


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


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/15196105/member-access-into-incomplete-type-calayer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!