ACEView - 在Cocoa应用中嵌入ACE编程器
jopen
12年前
在您的Cocoa应用程序中使用带劲的ACE编辑器。
#import "Cocoa/Cocoa.h" #import "ACEView/ACEView.h" @interface AppDelegate : NSObject{ IBOutlet ACEView *aceView; } @property (assign) IBOutlet NSWindow *window; @end #import "AppDelegate.h" #import "ACEView/ACEView.h" #import "ACEView/ACEModeNames.h" #import "ACEView/ACEThemeNames.h" @implementation AppDelegate - (void) applicationDidFinishLaunching:(NSNotification *)aNotification { // Note that you'll likely be using local text [aceView setString:[NSString stringWithContentsOfURL:[NSURL URLWithString:@"https://github.com/faceleg/ACEView"] encoding:NSUTF8StringEncoding error:nil]]; [aceView setDelegate:self]; [aceView setMode:ACEModeHTML]; [aceView setTheme:ACEThemeXcode]; [aceView setShowInvisibles:YES]; } - (void) textDidChange:(NSNotification *)notification { NSLog(@"%s", __PRETTY_FUNCTION__); } @end