I need to write a Mac project that can localize the annotation of the method and property in .h file.
I can use the code
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setAllowsMultipleSelection:YES];
[panel setMessage:@"Import one or more files or directories."];
[panel setCanChooseDirectories:YES];
[panel setDirectoryURL:[NSURL URLWithString:NSHomeDirectory()]];
[panel setAllowedFileTypes:[NSArray arrayWithObjects:@"h", nil]];
[panel beginWithCompletionHandler:^(NSInteger result) {
if (result == NSFileHandlingPanelOKButton)
{
NSArray *urls = [panel URLs];
NSLog(@"urls : %@",[urls description]);
}
}];
to get the URLs of the files.
But I can't find a way to scan all the .h file and get the content of the .h files,let alone exchange the annotation. I really appreciate your help,thank you.