Skip to content
This repository has been archived by the owner on Nov 7, 2018. It is now read-only.

Commit

Permalink
Support Xcode7.
Browse files Browse the repository at this point in the history
  • Loading branch information
MellongLau committed Sep 22, 2015
1 parent 327dc91 commit 8e37c89
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions AMMethod2Implement/AMMethod2Implement.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ - (NSArray *)escapeCharacterWithArray:(NSArray *)array
return mutableArray;
}

- (void)implementMethod:selectString
- (void)implementMethod:(NSString *)selectString
{
NSArray *currentClassName = [AMIDEHelper getCurrentClassNameByCurrentSelectedRangeWithFileType:AMIDEFileTypeHFile];
NSArray *methodList = [selectString componentsSeparatedByString:@";"];
Expand All @@ -116,13 +116,20 @@ - (void)implementMethod:selectString


NSInteger matchIndex = [methodItem getMatchIndexWithRegexList:_declareMap];

if (matchIndex != -1)
{
NSString *mfilePath = [AMIDEHelper getMFilePathOfCurrentEditFile];
if (hasOpenMFile == NO) {

[AMIDEHelper openFile:[AMIDEHelper getMFilePathOfCurrentEditFile]];
[AMIDEHelper openFile:mfilePath];
hasOpenMFile = YES;
}


while (![[AMIDEHelper getCurrentEditFilePath] isEqualToString:mfilePath]) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}

NSTextView *textView = [AMXcodeHelper currentSourceCodeTextView];
NSString *mFileText = textView.textStorage.string;
Expand Down Expand Up @@ -196,7 +203,14 @@ - (void)declareMethod:(NSString *)selectString{

if (matchIndex == AMImplementTypeMethod) {
NSArray *currentClassName = [AMIDEHelper getCurrentClassNameByCurrentSelectedRangeWithFileType:AMIDEFileTypeMFile];
[AMIDEHelper openFile:[AMIDEHelper getHFilePathOfCurrentEditFile]];
NSString *hfilePath = [AMIDEHelper getHFilePathOfCurrentEditFile];
[AMIDEHelper openFile:hfilePath];

while (![[AMIDEHelper getCurrentEditFilePath] isEqualToString:hfilePath]) {
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
}


NSTextView *textView = [AMXcodeHelper currentSourceCodeTextView];
NSString *hFileText = textView.textStorage.string;
NSRange trimStringRange = [selectString rangeOfString:@"{"];
Expand Down

0 comments on commit 8e37c89

Please sign in to comment.