æ¸ããæ¸ããã¨æã£ã¦ããã©å¿ãã¦ãã®ããPerlã¨ã³ã¸ãã¢ã®ããã®Objective-C Blockså ¥éãè¦ã¦æãåºãããããã¾ããã¿ã¤ãã«ã¯ä¾¿ä¹ã§ãã 試ãã«æ¸ãã¦ã¿ã Blocksã£ã¦ã®ãä½è ãªã®ãã¯ãã£ãã®è¨äºãªãAppleã®ããã¥ã¡ã³ããªããè¦ã¦ãããã°ããã¨æããã§ãããã¾ãã¦ã±ãè¯ããããªã®ã§ä»ããã¿ã¤ãã«ã«ã®ã£ã¨ã£ã¦Rubyã¨æ¯è¼ãã¦ã¿ãã f = lambda {|x| puts "#{x}ã®ãã¨ä»¥å¤ã¯ä½ãèããããªã" } f.call("ãã©ã") void (^f)(id) = ^(id x) { NSLog(@"ä¸çã®å ¨ã¦ãæµã«åãã¦ããåã¯%@ã®å³æ¹ã ", x); }; f(@"ãã©ã"); ãªãã ããã£ãããããªããä¼¼ã¦ãä¼¼ã¦ãã ä¸ãRubyçãä¸ãObjCçãä¸ã¯æ®éå¼æ°ã«ã¯NSString*ã¨ãã使ãã¨æããã©ãã¾ãRubyçã¨æåãåãããããã«idã«
{{#tags}}- {{label}}
{{/tags}}