{"id":592,"date":"2010-02-03T17:12:19","date_gmt":"2010-02-03T08:12:19","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=592"},"modified":"2012-01-03T22:17:10","modified_gmt":"2012-01-03T13:17:10","slug":"cygwin%e3%81%a7objective-c%e3%82%92%e5%ad%a6%e3%81%b61","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/592","title":{"rendered":"cygwin\u3067objective-c\u3092\u5b66\u3076(1)"},"content":{"rendered":"<p>iPad\u306e\u958b\u767a\u3092\u76ee\u6307\u3057\u3066\u3001\u601d\u3044\u4ed8\u304d\u3001objective-c\u3092\u59cb\u3081\u307e\u3057\u305f\u3002\u601d\u3044\u4ed8\u304d\u306a\u3082\u306e\u3060\u304b\u3089\u3001\u9014\u4e2d\u3067\u3084\u3081\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3057\u3001\u4e09\u65e5\u574a\u4e3b\u304b\u3082\u3057\u308c\u306a\u3044\u3057\u3001\u3068\u3002\u307e\u3041\u3001C\/C++\/C#\/Java\u4ee5\u5916\u306e\u8a00\u8a9e\u4f53\u7cfb\u3092\u5b66\u3093\u3067\u304a\u304f\u306e\u3082\u60aa\u304f\u306a\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u25a0cygiwn\u3067objective-c\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/p>\n<p>\u305d\u3093\u306a\u8a33\u3067\u3001\u624b\u5143\u306b\u306fmac\u304c\u3042\u308a\u307e\u305b\u3093(\u82e6\u7b11)\u306e\u3067\u3001cygwin\u3092\u4f7f\u3063\u3066\u3001objective-c\u3092\u52c9\u5f37\u3057\u307e\u3059\u3002\u6700\u7d42\u7684\u306b\u306f\u3001Xcode\u3092\u4f7f\u3063\u3066mac\u4e0a\u3067\u4f5c\u3089\u306a\u3044\u3068\u99c4\u76ee\u306a\u306e\u3067\u3059\u304c\u3001\u6587\u6cd5\u306a\u3068\u3053\u308d\u3068\u304b\u30ed\u30b8\u30c3\u30af\u306e\u30c6\u30b9\u30c8\u306a\u3068\u3053\u308d\u3068\u304b\u3001\u305d\u3046\u3044\u3046OS\u306b\u95a2\u4fc2\u306a\u3044\u3068\u3053\u308d\u306f\u3001\u3069\u306e\u74b0\u5883\u3067\u3082\u3067\u304d\u308b\u306f\u305a\u306a\u306e\u3067\u624b\u5143\u306ewindows\u74b0\u5883\u3067\u3084\u308a\u307e\u3059\u3002<\/p>\n<p>Objective-C\u3092Windows\u3067\u5229\u7528\u3059\u308b\u305f\u3081\u306b<br \/>\n<a href=\"http:\/\/take-blizzard.cocolog-nifty.com\/blog\/2009\/01\/objective-cwind.html\">http:\/\/take-blizzard.cocolog-nifty.com\/blog\/2009\/01\/objective-cwind.html<\/a><\/p>\n<p>\u306a\u3068\u3053\u308d\u3067\u3001objective-c\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3064\u3044\u3066\u8aac\u660e\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\ncygwin\u306eDevel\u30ab\u30c6\u30b4\u30ea\u306e\u300cgcc-objc\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u3068\u304d\u306f\u3001<\/p>\n<p>gcc sample.m<\/p>\n<p>\u3067\u3059\u306d\u3002\u30af\u30e9\u30b9\u3092\u4f7f\u3046\u3068\u304d\u306f\u3001objc \u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u5fc5\u8981\u3068\u3059\u308b\u306e\u3067\u3001<\/p>\n<p>gcc sample.m -l objc<\/p>\n<p>\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u3072\u3068\u307e\u305a\u3001<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#import &lt;stdio.h&gt;\r\n#import &lt;objc\/Object.h&gt;\r\n\r\nint main( void )\r\n{\r\nprintf(&quot;Hello objective-c World.\\n&quot;);\r\nreturn 0;\r\n}\r\n<\/pre>\n<p>\u304c\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p># printf\u95a2\u6570\u3092\u4f7f\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u304c\u5f31\u3044\u3067\u3059\u304c\u3002<br \/>\n\u25a0\u6587\u6cd5\u306e\u304a\u52c9\u5f37<\/p>\n<p>\u6587\u6cd5\u306b\u95a2\u3057\u3066\u306f\u3001C++\/C#\/Java\u306e\u3044\u305a\u308c\u304b\u3092\u7406\u89e3\u3057\u3066\u3044\u308b\u3068\u5b66\u7fd2\u304c\u65e9\u3044\u3067\u3057\u3087\u3046\u3002<br \/>\n\u3068\u3044\u3046\u304b\u3001\u3044\u304d\u306a\u308a objective-c \u3092\u5b66\u3076\u306e\u306f\u8f9b\u3044\u304b\u306a\u3001\u3068\u3002C\u8a00\u8a9e\u3092\u5b66\u3093\u3060\u3042\u3068\u306b\u3001\u5f15\u304d\u7d9a\u304d objective-c \u306b\u9032\u3080\u304b\u3001C++ \u304b\u3089\u978d\u66ff\u3048\u3059\u308b\u304b\u304c\u3044\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>Objective-C\u5165\u9580<br \/>\n<a href=\"http:\/\/wisdom.sakura.ne.jp\/programming\/objc\/index.html\">http:\/\/wisdom.sakura.ne.jp\/programming\/objc\/index.html<\/a><br \/>\nObjective-C Beginner&#8217;s Guide<br \/>\n<a href=\"http:\/\/www.otierney.net\/objective-c.html\">http:\/\/www.otierney.net\/objective-c.html<\/a><br \/>\nObjective-C\u3092Windows\u3067\u5229\u7528\u3059\u308b\u305f\u3081\u306b: \u30da\u30fc\u30b8\u30a2\u30a6\u30c8\u3055\u308c\u305f\u8a18\u61b6\u306e\u6b8b\u9ab8<br \/>\n<a href=\"http:\/\/take-blizzard.cocolog-nifty.com\/blog\/2009\/01\/objective-cwind.html\">http:\/\/take-blizzard.cocolog-nifty.com\/blog\/2009\/01\/objective-cwind.html<\/a><\/p>\n<p>\u3042\u305f\u308a\u3092\u53c2\u7167\u3057\u306a\u304c\u3089\u3001\u3086\u3063\u304f\u308a\u3068\u9032\u3080\u306e\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e\u306a\u306e\u3067\u3001\u57fa\u672c\u306fC++\u3084Java\u306a\u3093\u304b\u3068\u540c\u3058\u3067\u3059\u3002<br \/>\n\u66f8\u304d\u65b9\u304c\u5fae\u5999\u306a\u3068\u3053\u308d\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u306e\u3042\u305f\u308a\u304c\u8ff7\u3044\u307e\u3059\u304c\u3001\u982d\u306e\u4e2d\u306b\u5bfe\u5fdc\u8868\u3092\u6301\u3063\u3066\u304a\u3051\u3070\u3001\u76f4\u3050\u306b\u6163\u308c\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\n# \u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306b [obj method] \u3063\u3066\u3044\u3046\u62ec\u5f27\u3092\u4f7f\u3046\u306e\u304c\u3001\u3046\u30fc\u3080\u3063\u3066\u611f\u3058\u306a\u306e\u3067\u3059\u3002smalltalk \u304c\u305d\u3046\u306a\u306e\u304b\u306a\uff1f<\/p>\n<p>\u30af\u30e9\u30b9\u306b\u95a2\u3057\u3066\u306f\u3001\u3056\u3063\u3068\u8a18\u8ff0\u3059\u308b\u3068\u3001\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u306d\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#import &lt;stdio.h&gt;\r\n#import &lt;objc\/Object.h&gt;\r\n\r\n@interface Point : Object\r\n{\r\n\/\/ \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\r\nint _x, _y;\r\n}\r\n\/\/ \u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\r\n- (void)init ;\r\n- (void)print;\r\n- (void)setPoint:(int)x:(int)y;\r\n- (int)add;\r\n- (int)getX;\r\n- (int)getY;\r\n@end\r\n\r\n@implementation Point\r\n\/\/ \u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\r\n- (void)init {\r\n&#x5B;super init];\u00a0\/\/ \u89aa\u30af\u30e9\u30b9\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3092\u547c\u3073\u51fa\u3057\r\n}\r\n\/\/ \u5f15\u6570\u306e\u306a\u3044\u95a2\u6570\r\n- (void)print {\r\nprintf(&quot;x:%d y:%d\\n&quot;, _x, _y );\r\n}\r\n\/\/ \u5f15\u6570\u306e\u3042\u308b\u95a2\u6570\r\n- (void)setPoint:(int)x:(int)y {\r\n_x = x;\r\n_y = y;\r\n}\r\n\/\/ \u623b\u308a\u5024\u3092\u4f7f\u3046\r\n- (int)add {\r\nreturn _x + _y;\r\n}\r\n\/\/ \u30d7\u30ed\u30d1\u30c6\u30a3\u6271\u3044\r\n- (int)getX {\r\nreturn _x;\r\n}\r\n- (int)getY {\r\nreturn _y;\r\n}\r\n@end\r\n\r\nint main() {\r\n\/\/ \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\r\nPoint *pt = &#x5B;Point new];\r\n\/\/ \u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\r\n&#x5B;pt setPoint: 10: 20 ];\r\n\/\/ \u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\r\n&#x5B;pt print];\r\n\/\/ \u30d7\u30ed\u30d1\u30c6\u30a3\u547c\u3073\u51fa\u3057\r\nprintf(&quot;x:%d y:%d\\n&quot;, &#x5B;pt getX], &#x5B;pt getY] );\r\n\/\/ \u623b\u308a\u5024\u3092\u4f7f\u3046\r\nint ret = &#x5B;pt add];\r\nprintf(&quot;ret:%d\\n&quot;, ret );\r\n\/\/ \u89e3\u653e\r\n&#x5B;pt free];\r\n\r\nreturn 0;\r\n}\r\n<\/pre>\n<p>\u30e1\u30bd\u30c3\u30c9\u306e\u5b9a\u7fa9\u3068\u547c\u3073\u51fa\u3057\u304c\u3001C\u8a00\u8a9e\u3068\u9055\u3063\u3066\u5999\u306a\u611f\u3058\u3067\u3059\u304c\u3001\u307e\u3041\u3001\u3053\u308c\u3082\u6163\u308c\u3067\u3059\u306d\u3002C\u8a00\u8a9e\u306e\u95a2\u6570\u3092\u4f7f\u308f\u306a\u3051\u308c\u3070\u3001[obj method: p1: p2]\u306a\u5f62\u304c\u7f85\u5217\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u307b\u3069\u9055\u548c\u611f\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u25a0NSString\u306e\u554f\u984c<\/p>\n<p>\u3068\u3001\u3053\u3053\u307e\u3067\u66f8\u3044\u3066\u3067\u3059\u306d\u3001iPhone SDK\u3067\u306f\u300cNSString\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u30af\u30e9\u30b9\u304c\u591a\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3092\u601d\u3044\u51fa\u3057\u307e\u3057\u305f\u3002\u8abf\u3079\u3066\u307f\u308b\u3068\u3001cygwin\u306eobjective-c\u306b\u306f NSString \u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u56f0\u3063\u305f&#8230;<br \/>\n\u3053\u3046\u3044\u3046\u5834\u5408\u306f\u3001GnuStep \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304d\u3066\u3001\u3084\u308b\u304b\u3002<br \/>\n<a href=\"http:\/\/www.gnustep.org\/\">http:\/\/www.gnustep.org\/<\/a><\/p>\n<p>cygwin\u7248\u306eNSString\u3092\u4f5c\u3063\u3066\u3057\u307e\u3046\u304b\u3001\u3067\u3059\u306d\u3002<\/p>\n<p><a href=\"http:\/\/osdir.com\/ml\/lib.gnustep.user\/2001-09\/msg00030.html\">http:\/\/osdir.com\/ml\/lib.gnustep.user\/2001-09\/msg00030.html<\/a><br \/>\n\u306b\u3042\u308b\u3088\u3046\u306b\u3001gnustep-objc-1.0.1.tar.gz \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001cygwin\u306egcc\u3067\u30d3\u30eb\u30c9\u3057\u3066\u4f7f\u3046\u3063\u3066\u306e\u3082\u3042\u308a\u3067\u3059\u304c\u3001\u3001\u3001\u3061\u3087\u3063\u3068\u5927\u8888\u88df\u3060\u306a\u3041\u3002<\/p>\n<p># Windows\u74b0\u5883\u3067\u8a66\u3059\u610f\u7fa9\u3068\u3057\u3066\u306f\u3001\u5b66\u7fd2\u7528\u3068\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u4f5c\u6210\u306b\u3042\u308b\u306e\u3067\u3001<br \/>\n# \u6587\u5b57\u5217\u30af\u30e9\u30b9\u7a0b\u5ea6\u3067\u3042\u308c\u3070\u3001\u30b9\u30bf\u30d6\u3067\u7528\u610f\u3057\u3066\u304a\u304f\u306e\u304c\u3044\u3044\u3067\u3057\u3087\u3046\u306d\u3047\u3002<br \/>\n# \u30e6\u30fc\u30b6\u30fc\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306a\u3093\u304b\u306f\u3001\u7d50\u5c40 interface builder \u3092\u4f7f\u308f\u306a\u3044\u3068<br \/>\n# \u99c4\u76ee\u3060\u304b\u308d\u3046\u304b\u3089\u3001mac osx \u4e0a\u3067\u306a\u3044\u3068\u3067\u304d\u306a\u3044\u3060\u308d\u3046\u3057\u3002<\/p>\n<p>\u3042\u3041\u3001\u305d\u308c\u3067\u3082\u3063\u3066\u3001cygwin\u306eobjc\u3092\u4f7f\u3063\u3066\u3001nsstring\u3082\u3069\u304d\u3092\u4f5c\u308d\u3046\u3068\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3082cygwin\u306eobjc\u306f\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u52d5\u304d\u304c\u9055\u3046\u3088\u3046\u3067\u3059\u3002\u591a\u91cd\u5b9a\u7fa9\u304c\u3067\u304d\u306a\u3044\u3001\u3068\u3044\u3046\u304b\u30e1\u30bd\u30c3\u30c9\u306e\u5f15\u6570\u306b\u30e9\u30d9\u30eb\u3092\u4f7f\u3048\u306a\u3044\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u5f8c\u65e5\u3002<\/p>\n<p>\u5148\u306e\u4f8b\u3067\u8a00\u3048\u3070\u3001<\/p>\n<p>&#8211; (void)setPoint:(int)x:(int)y;<\/p>\n<p>\u306f\u53ef\u80fd\u3060\u3051\u3069<\/p>\n<p>&#8211; (void)setPoint x:(int)x y:(int)y;<\/p>\n<p>\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u3084\u3084\u3053\u3057\u3044\u3053\u3063\u3061\u3083\u3002<\/p>\n<p>\u2605\u8ffd\u8a18<\/p>\n<p>\u3072\u3068\u3064\u76ee\u306e\u5f15\u6570\u306b\u306f\u540d\u524d\u304c\u3064\u3051\u3089\u308c\u306a\u3044\u3089\u3057\u3044\u3002<\/p>\n<p>&#8211; (void)setPoint :(int)x y:(int)y;<\/p>\n<p>\u3060\u3068\u3001\u901a\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>&#8212;<\/p>\n<p>\u8ffd\u8a18 2012\/01\/03<br \/>\n\u3068\u3044\u3046\u8a33\u3067\u3001cygwin \u3067\u3082 objective-c \u306e\u5b66\u7fd2\u306f\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u672c\u6765\u306e\u76ee\u7684\u304c iphone\/ipad \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u5834\u5408\u306f\u3001GNUstep + clang + llvm \u3068\u3044\u3046\u7d44\u307f\u5408\u308f\u305b\u306b\u306a\u308a\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Windows\u3067\u5b66\u3076Objective-C | Moonmile Solutions Blog<br \/>\n<a href=\"Windows\u3067\u5b66\u3076Objective-C | Moonmile Solutions Blog http:\/\/www.moonmile.net\/blog\/article\/windows-objective-c\">http:\/\/www.moonmile.net\/blog\/article\/windows-objective-c<br \/>\n<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iPad\u306e\u958b\u767a\u3092\u76ee\u6307\u3057\u3066\u3001\u601d\u3044\u4ed8\u304d\u3001objective-c\u3092\u59cb\u3081\u307e\u3057\u305f\u3002\u601d\u3044\u4ed8\u304d\u306a\u3082\u306e\u3060\u304b\u3089\u3001\u9014\u4e2d\u3067\u3084\u3081\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u3057\u3001\u4e09\u65e5\u574a\u4e3b\u304b\u3082\u3057\u308c\u306a\u3044\u3057\u3001\u3068\u3002\u307e\u3041\u3001C\/C++\/C#\/Java\u4ee5\u5916\u306e\u8a00\u8a9e\u4f53\u7cfb\u3092\u5b66\u3093\u3067\u304a\u304f\u306e\u3082\u60aa\u304f\u306a\u3044 &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/592\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":2742,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-592","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"jetpack_featured_media_url":"http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2012\/01\/windows-objective-c-title.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=592"}],"version-history":[{"count":4,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions"}],"predecessor-version":[{"id":2762,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions\/2762"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}