Created
March 16, 2013 08:49
-
-
Save taishi41228/5175567 to your computer and use it in GitHub Desktop.
文字列が等しいかどうか判断する簡単なプログラム ref: http://qiita.com/items/bd55613d94283a9f7dc0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
@interface AppDelegate : NSObject <NSApplicationDelegate> { | |
IBOutlet NSTextField* field1; | |
IBOutlet NSTextField* field2; | |
IBOutlet NSTextField* result; | |
} | |
@property (assign) IBOutlet NSWindow *window; | |
- (IBAction)isEqual:(id)sender; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "AppDelegate.h" | |
@implementation AppDelegate | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
// Insert code here to initialize your application | |
} | |
- (IBAction)isEqual:(id)sender { | |
if ([[field1 stringValue] isEqualTo:[field2 stringValue]]) { | |
[result setStringValue:@"等しい"]; | |
} else { | |
[result setStringValue:@"等しくない"]; | |
} | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Cocoa/Cocoa.h> | |
int main(int argc, char *argv[]) | |
{ | |
return NSApplicationMain(argc, (const char **)argv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment