“Variable Undeclared” error when compiling to iOS Device, but not for Simulator

后端 未结 10 1340
时光取名叫无心
时光取名叫无心 2020-12-31 10:15

I have an custom UIVIewController that is the base class for other controllers and has an instance of a custom UIView variable that is accessed by inherited the classes.

10条回答
  •  温柔的废话
    2020-12-31 11:13

    I had the exact same problem and it turns out that I did not remove an unused iVar/property in the SUBCLASS. Let's call it session. I removed _session from the iVar but I forgot to remove it from the properties, then in the .m file I had this synthesize session = _session. Once I removed them all, I can compile for iOS device without problems.

    If you think your superclass is fine, look into your subclass, check your iVars and properties and synthesize section in the .m file

提交回复
热议问题