开发者

xcode: property 'title' 'copy' attribute does not match super class 'UIViewController' property

Hi I'm currently getting this error message. and by the love of banana, I cannot figure out what I am not doing right.

Its just an

IBOutlet UILabel *title;

and

@property(nonatomic, retain) IBOutlet UILabel *title;

I've made which is connected to my xib file connected to a UILabel because I dynamically change the title during run time.

Classes/../taskViewController.h:44: warning: property 'title' 'copy' attribute does not match super class 'UIViewController' property

I dont understand what it means. Normally i am able to get rid of warning messages. But this one... I dont have a clue whats开发者_开发百科 going on.

Can someone please guide me and explain what is happening here.


Your problem is that UIViewController already defines a title property and you are using a different memory manangement option than it does. To fix this, change the name of your property. ex: @property (nonatomic, copy) UILabel *titleLabel;. If you want the instance variable to have the same name, and you use @synthesize, use @synthesize titleLabel=title;.

As an aside, why are you copying a UILabel? Normally you would use retain so that it is the same object.


It means:

  • you have a subclass of UIViewController
  • it contains a property named "title"
  • you have declared the property with the "copy" attribute
  • the parent class (UIViewController) already has "title" property with a conflicting definition (i.e., not "copy")


Well i want to just clarify that title is a predefined object in the UIViewController so you cannot create your own objects with that same name, change the with some thing else and see that it wont give you that error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜