Jestem nowicjuszem w Objective C i próbuję dowiedzieć się, co robi operator ^? Podczas eksploracji kodu źródłowego zobaczyłem następną konstrukcję:Objective-C the^operator
dispatch_once(&onceToken, ^{
UIGraphicsBeginImageContextWithOptions(CGSizeMake(20.f, 13.f), NO, 0.0f);
[[UIColor blackColor] setFill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 0, 20, 1)] fill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 5, 20, 1)] fill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 10, 20, 1)] fill];
[[UIColor whiteColor] setFill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 1, 20, 2)] fill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 6, 20, 2)] fill];
[[UIBezierPath bezierPathWithRect:CGRectMake(0, 11, 20, 2)] fill];
defaultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
});
Chciałabym wiedzieć, co to jest?
Przeczytaj to: http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/00_Introduction.html –
@DanielSchneller Powiedziałbym, że dzieje się tak, ponieważ w tym przypadku bardzo trudno jest znaleźć dokumentację na blokach, jeśli nie wiesz, jak się nazywa. Możesz przeczytać przewodnik Objective-C, ale nie jest to najlepszy sposób na naukę. –
@RogerNolan Całkowicie się z tobą zgadzam, dziękuję. – HackU