Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 目标C中的“^”是什么意思?_Objective C - Fatal编程技术网

Objective c 目标C中的“^”是什么意思?

Objective c 目标C中的“^”是什么意思?,objective-c,Objective C,目标C中的字符是什么意思?就像下面的代码一样 TWTweetComposeViewControllerCompletionHandler completionHandler = ^(TWTweetComposeViewControllerResult result) { switch (result) { ... } [self dismissModalViewControllerAnima

目标C中的字符是什么意思?就像下面的代码一样

TWTweetComposeViewControllerCompletionHandler 
    completionHandler =
    ^(TWTweetComposeViewControllerResult result) {
        switch (result)
        {
            ...
        }
        [self dismissModalViewControllerAnimated:YES];
    };

它用作块定义的一部分:

^(return_type retval) {
  statements;
}
您也可以将其视为块声明的一部分。

这是一个“块”,您可以在中了解它,它主要用于多线程。

它表示一个“块”,一段代码,可以打包到一个对象中,稍后使用。在您的示例中,它指定了稍后调用的完成处理程序,可能是在用户单击“OK”或类似按钮关闭警报时调用的


块还可以与Grand Central Dispatch一起使用,在这种情况下,它们用于生成可以在另一个线程上同步和异步运行的代码单元

这叫做插入符号。在C.10^4=14中也是按位异或。