Property cannot be found on forward class object?

前端 未结 2 523
日久生厌
日久生厌 2020-12-14 06:16

I have a UIView and I\'m trying to set its layer properties.

self.colorSwatch = [[UIView alloc] initWithFrame:CGRectMake(400, 150, 100, 100)];
self.colorSwat         


        
相关标签:
2条回答
  • 2020-12-14 06:34

    It doesn't know what type of object the layer property is. Add #import <QuartzCore/QuartzCore.h> to the top of your file.

    0 讨论(0)
  • 2020-12-14 06:53

    You need to import the file #import < QuartzCore/QuartzCore.h> in ViewController.m class if and only if xcode version is less than 5.

    See if you are using xcode version 5 or latest than that then not required to import .It is automatically included.

    0 讨论(0)
提交回复
热议问题