Can't refactor property type?

Hello,  I have a property in an interface like this:

@property (nonatomic, strong) SomeConcreteClass *myThing;

It is used in many places throughout my project.

I need to change the property's type to be id<SomeProtocol>, or even NSObject<SomeProtocol>* so that it would look like this:

@property (nonatomic, strong) id<SomeProtocol>myThing;

or

@property (nonatomic, strong) NSObject<SomeProtocol> *myThing;

Ideally, any place in the code that referenced this property value would change the type of the referenceing variable to be id<SomeProtocol> as well, since the existing ConcreteClasses all conform to SomeProtocol, but minimally it should change the signature and any implemented accessor method names.  

I can refactor the _name_ of the property, but not the _type_ in AppCode.  If this were a method and I was changing the return type, it would be as easy as activating the "Change Signature" refactor.  However, this refactor does not work on properties.  Is there something I'm missing or some way I can accomplish my intent with AppCode refactoring on this?

Thanks!

2 comments
Comment actions Permalink
If this were a method and I was changing the return type, it would be as easy as activating the "Change Signature" refactor.


Change signature doesn not work as you are describing, because the type of a referencing variable is not always equal to the type of a property and it is not clear what exactly IDE should do in non-trivial cases.

Changing the type of the corresponding accessor methods makes sense, though. I've created an issue on our tracker: http://youtrack.jetbrains.com/issue/OC-9293

0
Comment actions Permalink

Thanks for the answer and for creating that bug ticket!  I upvoted it, and hopefully we'll see it in a near future release...

0

Please sign in to leave a comment.