ios - What is the caret symbol (^) and where is it defined? -


this question has answer here:

i saw following code:

[uiview animatewithduration:5.0 animations:^ {     iv.alpha = 1.0;//iv uiimageview }]; 

supposedly ^ defines function block or something. similar delegate? part of c/c++ or objective-c? cannot option+click symbol go in documentation.

the caret symbol creates block, similar delegate. it's type of closure—a function defined inline has access variables in parent scope, can used simplify types of delegate-/callback-oriented code.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -