Minor Refactor->Move... issue?

When I use this command within objective-c code, I get what look like c++ templates in the newly created files.  Am I
missing a setting or is this a bug?  (or intentional?)

Example .h file after Move on @interface MovedClass


#ifndef __MovedClass_H_
#define __MovedClass_H_

#endif //__MovedClass_H_

4 comments

David, why do you need guard-blocks in the Objective-C code?

0

Apologies, I was pointed out by my colleague, that I incorrectly read the question.

It indeed looks like a bug; could you please give a bit more details/type of original file/code snippet?
Is the problem reproducible if yes, what are the steps?

0

Yes, you've got it right now.  I *don't* want the guard blocks but they are produced.

100% reproducible.
Here is a simple way to recreate it:

New->Project->IOSApplication->Empty Application

In the newly created AppDelegate.m, add the following above the "@implementation AppDelegate" line:

@interface MoveMe
@end

@implementation MoveMe
@end


Click on a MoveMe and choose Refactor->Move, and choose to Move it to a new file.

Inspecting the new files reveals the issue: C++ style guards in the header and a #include in the implementaiton file.

I doubt any step is needed other than clicking on a class and choosing to move it to a new file.  Actually I just did that, and it repro'd.

Very minor bug.

__

In general, I notice certain issues, possibly bugs, and usuabilty issues when dealing with multiple classes in one file.  I don't generally report them because "one class one file" is best practice.  Should I anyway?

0

Thanks for the details, David
I have reproduced this issue. Unfortunately there is no way to workaround this at the moment, we'll see if we can fix it in the next major update.

0

Please sign in to leave a comment.