I have been trying to understand the notation for objective C its using the CAP(^) character along with the functions.
我一直试图理解目标C的符号,它使用CAP(^)字符和函数。
Can someone please enlighten me with the fact what this means and what this is used for.
有人可以告诉我这意味着什么以及它的用途。
Thanks Jay
EG: ^(void)
2 个解决方案
#1
2
They are called "blocks", which are closures for Objective C.
它们被称为“块”,它们是Objective C的闭包。
More about closures in general: http://en.wikipedia.org/wiki/Closure_%28computer_science%29
关于闭包的更多信息:http://en.wikipedia.org/wiki/Closure_%28computer_science%29
More about objective C blocks: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
有关目标C块的更多信息:http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
#2
5
this notation is used for block in iOS. You can check more details on - http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
这种表示法用于iOS中的块。您可以查看更多详细信息 - http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
#1
2
They are called "blocks", which are closures for Objective C.
它们被称为“块”,它们是Objective C的闭包。
More about closures in general: http://en.wikipedia.org/wiki/Closure_%28computer_science%29
关于闭包的更多信息:http://en.wikipedia.org/wiki/Closure_%28computer_science%29
More about objective C blocks: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
有关目标C块的更多信息:http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
#2
5
this notation is used for block in iOS. You can check more details on - http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
这种表示法用于iOS中的块。您可以查看更多详细信息 - http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html