Objective-c 中的 Smalltalk 块?
Objective-C 是否支持“a la Smalltalk”块?
在 Smalltalk 中,块类似于其他语言中的“闭包”或“lambda 表达式”或“无名函数”。
Does Objective-C support blocks "a la Smalltalk"?
In Smalltalk, blocks are similar to "closures" or "lambda-expressions" or "nameless functions" found in other languages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的:http://developer.apple。 com/library/mac/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
开箱即用,它们仅在 XCode 3.2 或更高版本附带的 Objective-C 2.0 版本中受支持。这意味着如果您想使用官方构建工具,您将需要 Snow Leopard。此处描述了 10.5 的潜在解决方法:http://thirdcog.eu/pwcblocks/#leoiphone
Yes: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
Out of the box, they're only supported in the version of Objective-C 2.0 that comes with XCode 3.2 or later. This means you'll need Snow Leopard if you want to use the official build tools. A potential work-around for 10.5 is described here: http://thirdcog.eu/pwcblocks/#leoiphone
是的,
举个例子:
Yep,
take this example: