error: property 'myBoolVariableName' with 'retain' attribute must be of object type

后端 未结 2 1834
有刺的猬
有刺的猬 2021-02-13 23:29

I have a BOOL value inside my @interface definition in my .h file. Here it is below. It has the same problem whether it\'s a pointer or not.

@interface myCusto         


        
2条回答
  •  广开言路
    2021-02-14 00:28

    I have faced similar situation. I solved it like,

    @interface myCustomViewController : UIViewController {
    BOOL myBoolVariableName;
    }
    @property BOOL myBoolVariableName;
    @end
    

    I refer one answer by Jon Hess but I got one error in it. Type name requires a specifier or qualifier. My previous version was like,

    @property myBoolVariableName;
    

    So I added BOOL and solved the issue.

提交回复
热议问题