Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 472
Pavan Avatar asked Jan 11 '11 02:01

Pavan


2 Answers

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.

like image 79
ughoavgfhw Avatar answered Oct 03 '22 06:10

ughoavgfhw


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")
like image 42
David Gelhar Avatar answered Oct 03 '22 06:10

David Gelhar