{"id":597,"date":"2010-02-05T11:15:12","date_gmt":"2010-02-05T02:15:12","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/?p=597"},"modified":"2012-01-02T11:05:59","modified_gmt":"2012-01-02T02:05:59","slug":"gnustep%e3%81%a7objective-c%e3%82%92%e5%ad%a6%e3%81%b62","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/597","title":{"rendered":"GNUstep\u3067objective-c\u3092\u5b66\u3076(2)"},"content":{"rendered":"<p>objective-c\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3067\u3001\u591a\u91cd\u5b9a\u7fa9\u306e\u3068\u3053\u308d\u304c\u8151\u306b\u843d\u3061\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u4e00\u5fdc\u6c37\u89e3\u3057\u305f\u306e\u3067\u3001\u8a18\u9332\u3068\u3057\u3066\u3002<\/p>\n<p>C++ \u306e\u5834\u5408\u3001\u6b21\u306e\u3088\u3046\u306b\u30e1\u30bd\u30c3\u30c9\u306e\u591a\u91cd\u5b9a\u7fa9\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nclass A\r\n{\r\npublic:\r\nvoid print( int x );\r\nvoid print( char *s );\r\n};\r\n<\/pre>\n<p>int\u578b\u306e\u5f15\u6570\u3092\u6301\u3064\u5834\u5408\u3068\u3001char*\u578b\u306e\u5f15\u6570\u3092\u6301\u3064\u5834\u5408\u306e\u95a2\u6570\u3092\u300cprint\u300d\u3068\u3044\u3046\u540c\u3058\u540d\u524d\u304c\u4f7f\u3048\u308b\u308f\u3051\u3067\u3059\u3002C\u8a00\u8a9e\u306e\u5834\u5408\u306f\u300cprintInt\u300d\u3001\u300cprintString\u300d\u306a\u3093\u3066\u540d\u524d\u3092\u5909\u3048\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u3053\u306e\u591a\u91cd\u5b9a\u7fa9\u306f\u540d\u524d\u3092\u5b9a\u7fa9\u3059\u308b\u969b\u306b\u975e\u5e38\u306b\u91cd\u8981\u306a\u6a5f\u80fd\u306a\u306e\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3092\u3001\u300c\u7d20\u76f4\u300d\u306bobjective-c \u306e\u6587\u6cd5\u306b\u76f4\u305d\u3046\u3068\u3059\u308b\u3068\u3001<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n@interface A : NSObject\r\n- (void)print:(int)x ;\r\n- (void)print:(char*)s ;\r\n@end\r\n<\/pre>\n<p>\u3068\u66f8\u304d\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001\u3001\u3001\u3067\u304d\u307e\u305b\u3093\u3002\u540d\u524d\u304c\u91cd\u8907\u3057\u3066\u308b\uff08duplicate declaration of method &#8216;-print:&#8217;\uff09\u306a\u308b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5b9f\u306f\u3001objective-c\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u66f8\u304d\u65b9\u306f\u3001<\/p>\n<p>&#8211; \u30e1\u30bd\u30c3\u30c9\u540d :(\u578b)\u4eee\u5f15\u6570 :(\u578b)\u4eee\u5f15\u6570 ;<\/p>\n<p>\u306a\u306e\u304b\u3068\u601d\u3044\u8fbc\u3093\u3067\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f\u9055\u3044\u307e\u3059\u3002<br \/>\n\u6700\u521d\u306e\u5358\u8a9e\u3082\u542b\u3081\u3066\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u3068\u4eee\u5f15\u6570\u306e\u30da\u30a2\u306a\u3093\u3067\u3059\u306a\u3041\u3002<\/p>\n<p>&#8211; \u30ad\u30fc\u30ef\u30fc\u30c9:(\u578b)\u4eee\u5f15\u6570 \u30ad\u30fc\u30ef\u30fc\u30c9:(\u578b)\u4eee\u5f15\u6570 ;<\/p>\n<p>\u3068\u8003\u3048\u308b\u306e\u304c\u6b63\u3057\u3044\u306e\u3067\u3059\u3002<br \/>\n\u3067\u3001objective-c\u306e\u5834\u5408\u306f\u3001\u578b\u306e\u9055\u3044\u3092\u30c1\u30a7\u30c3\u30af\u5224\u5225\u305b\u305a\u306b\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u9055\u3044\u3067\u5224\u5225\u3057\u307e\u3059\u3002\u305d\u3093\u306a\u8a33\u3067\u3001<\/p>\n<p>&#8211; print:(int)x :(int)y ;<br \/>\n&#8211; print:(int)x z:(int)z ;<\/p>\n<p>\u306e2\u3064\u306f\u30ad\u30fc\u30ef\u30fc\u30c9\u7121\u3057\u3068\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u3042\u308a\u300cz\u300d\u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u9055\u3044\u304c\u8a8d\u8b58\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3001\u6700\u521d\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u3068\u578b\u306e\u30da\u30a2<\/p>\n<p>&#8211; print:(int)x;<br \/>\n&#8211; print:(char*)s;<\/p>\n<p>\u306e2\u3064\u306f\u3001\u540c\u3058 print \u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u300c\u91cd\u8907(duplicate)\u300d\u3063\u3066\u306a\u8a33\u3067\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067\u3059\u3002<\/p>\n<p># objective-c \u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u898b\u3066\u3001\u5999\u306a\u30e1\u30bd\u30c3\u30c9\u306e\u540d\u524d\u306e\u4ed8\u3051\u65b9\u3092\u3057\u3066\u308b<br \/>\n# \u306a\u3042\u3001\u3068\u601d\u3063\u3066\u3044\u305f\u3089\u3001\u305d\u3046\u3044\u3046\u7406\u7531\u304c\u3042\u3063\u305f\u3093\u3067\u3059\u306d&#8230;<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#import &lt;stdio.h&gt;\r\n#import &lt;Foundation\/Foundation.h&gt;\r\n#import &lt;Foundation\/NSObject.h&gt;\r\n\r\n@interface A : NSObject\r\n- (void)print ;\r\n\/\/- (void)print :(void) ;\u00a0\u00a0\/\/ \u3067\u304d\u306a\u3044\r\n- (void)print:(int)x ;\r\n\/\/- (void)print:(char*)s ;\u00a0\u00a0\/\/ \u91cd\u8907\u3059\u308b\u305f\u3081\u3067\u304d\u306a\u3044\r\n- (void)print:(int)x\u00a0 :(int)y ;\r\n- (void)print:(int)x z:(int)z ; \/\/ \u30ad\u30fc\u30ef\u30fc\u30c9\u3067\u533a\u5225\u3067\u304d\u308b\r\n@end\r\n\r\n#if 0\r\n\/\/ C++\u306e\u5834\u5408\r\n\r\nclass A\r\n{\r\npublic:\r\n\/\/ void print();\r\nvoid print( void );\u00a0\u00a0\/\/ print()\u3068\u540c\u3058\u610f\u5473\r\nvoid print( int x );\r\nvoid print( char *s );\r\nvoid print( int x, int y );\r\n\/\/ void pritn( int x, int z );\u00a0\/\/ \u3067\u304d\u306a\u3044\r\n\r\n};\r\n#endif\r\n\r\n@implementation A\r\n- (void)print {\r\nprintf(&amp;quot;in print\\n&amp;quot;);\r\n}\r\n\r\n- (void)print:(int)x {\r\nprintf(&amp;quot;in print x\\n&amp;quot;);\r\n}\r\n\r\n- (void)print:(int)x :(int)y {\r\nprintf(&amp;quot;in print x y\\n&amp;quot;);\r\n}\r\n\/*\r\n- (void)print:(char*)s {\r\nprintf(&amp;quot;in print s\\n&amp;quot; );\r\n}\r\n*\/\r\n- (void)print:(int)x z:(int)z {\r\nprintf(&amp;quot;in print x z\\n&amp;quot;);\r\n}\r\n\r\n@end\r\n\r\nint main( void )\r\n{\r\nprintf(&amp;quot;hello3.m\\n&amp;quot; );\r\n\r\nA *a = &#x5B;A new];\r\n&#x5B;a print];\r\n&#x5B;a print :1];\r\n&#x5B;a print :1 :2 ];\r\n&#x5B;a print :1 z:2 ];\r\n&#x5B;a release];\r\nreturn 1;\r\n}\r\n\/** \u5b9f\u884c\u7d50\u679c\r\n\r\nhello3.m\r\nin print\r\nin print x\r\nin print x y\r\nin print x z\r\n\r\n**\/\r\n<\/pre>\n<p>\u305d\u3093\u306a\u8a33\u3067\u3001\u3072\u3068\u3064\u306e\u5f15\u6570\u3060\u3051\u306e\u5834\u5408\u306f\u3001\u5b9f\u8cea\u3001\u591a\u91cd\u5b9a\u7fa9\u304c\u3067\u304d\u307e\u305b\u3093\u3002C\u8a00\u8a9e\u306e\u3088\u3046\u306b\u300cprintInt\u300d\u3001\u300cprintString\u300d\u3068\u3057\u3066\u30e1\u30bd\u30c3\u30c9\u540d\u3067\u533a\u5225\u3092\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p># \u5b9f\u306b\u300c\u5bfe\u79f0\u6027\u300d\u304c\u60aa\u3044\uff01\u3068\u601d\u3046\u306e\u306f\u79c1\u3060\u3051\u3067\u306f\u306a\u3044\u30cf\u30ba\u3002<br \/>\n# \u305f\u3060\u3001objective-c\u306e\u767a\u7965\u6642\u671f\u3092\u8003\u3048\u308b\u3068\u3001C\u30ea\u30f3\u30b1\u30fc\u30b8\u306e\u8003\u616e\u304b\u3089\u3001\u3053\u3046\u3044\u3046\u5f62\u306b<br \/>\n# \u306a\u3063\u3066\u3044\u308b\u306e\u3060\u3068\u601d\u3046\u3002\u30ea\u30f3\u30ab\u30fc\u306b\u5bfe\u3057\u3066\u53b3\u5bc6\u306a\u540d\u524d\u3092\u4f7f\u3046C++\u306b\u5bfe\u3057\u3066(C\u8a00\u8a9e\u81ea\u4f53<br \/>\n# \u306e\u30ea\u30f3\u30b1\u30fc\u30b8\u306f\u304b\u306a\u308a\u7de9\u3044)\u3001objective-c\u306f\u305d\u306e\u307e\u307eC\u8a00\u8a9e\u306e\u30ea\u30f3\u30af\u3092\u4f7f\u3046\u3088\u3046\u306b<br \/>\n# \u3057\u305f\u306e\u3067\u3001\u3053\u3046\u3044\u3046\u7d50\u679c\u306b\u306a\u3063\u305f\u306e\u3067\u306f\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>objective-c\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3067\u3001\u591a\u91cd\u5b9a\u7fa9\u306e\u3068\u3053\u308d\u304c\u8151\u306b\u843d\u3061\u306a\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u4e00\u5fdc\u6c37\u89e3\u3057\u305f\u306e\u3067\u3001\u8a18\u9332\u3068\u3057\u3066\u3002 C++ \u306e\u5834\u5408\u3001\u6b21\u306e\u3088\u3046\u306b\u30e1\u30bd\u30c3\u30c9\u306e\u591a\u91cd\u5b9a\u7fa9\u304c\u3067\u304d\u307e\u3059\u3002 class A { public: v &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/597\">\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,28],"tags":[],"class_list":["post-597","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev","category-objc"],"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\/597","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=597"}],"version-history":[{"count":3,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/597\/revisions"}],"predecessor-version":[{"id":2737,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/597\/revisions\/2737"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media\/2742"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}