Top "Objective-c-blocks" questions

Blocks are Apple’s implementation of closures for C, which are also available for Objective-C and C++.

Access C Array within blocks (variable array count) Objective-C

Blocks are fine but what about writing C arrays? Given this simplified situation: CGPoint points[10]; [myArray forEachElementWithBlock:^(int idx) { points[…

objective-c struct core-graphics objective-c-blocks arrays
Waiting for multiple blocks to finish

I have those methods to retrieve some object information from the internet: - (void)downloadAppInfo:(void(^)())success failure:(void(^)(NSError *…

ios objective-c-blocks grand-central-dispatch nsoperation nsoperationqueue
recursive block and retain cycles in ARC

EDIT2: No. The suggested answer is about async calls. I want & need synchronous calls, like in a normal, standard …

objective-c recursion automatic-ref-counting objective-c-blocks retain-cycle
UIScrollView touch events during animation not firing with animateWithDuration: but work fine with UIView beginAnimations:

I have a UIScrollView subclass that I am programmatically scrolling using UIView animations. I'd like the user to be able …

uiview uiscrollview uiviewanimation objective-c-blocks
Cocoa blocks as strong pointers vs copy

I did work several times with blocks as with pointers to which i had strong reference I heard that you …

objective-c cocoa automatic-ref-counting objective-c-blocks
Pass a block to a C++ method from objective C

I have a C++ helper class that I use with objective-C. I would like to pass the c++ class a …

c++ objective-c ios4 objective-c-blocks
Why doesn't Remove Observer from NSNotificationCenter:addObserverForName:usingBlock get called

I'm confused on why the observer is never removed in the following code. In my viewDidAppear I have the following: …

iphone ios objective-c-blocks nsnotifications nsnotificationcenter
incompatible block pointer types initializing 'void(^)(struct ALAssetsGroup *, BOOL *)'with an expression of type

I saw several people on SO have been using this code successfully. But I got the incompatible block pointer error: …

ios objective-c objective-c-blocks alassetslibrary alasset
Return Boolean from Block in Swift

I am trying to use Parse written with Swift. I am able to log in without any trouble but I …

swift boolean objective-c-blocks completion
Can I cancel a Block added to an NSOperationQueue with addOperationWithBlock:?

I've read many many articles which say "BLOCKS ARE THE FUTURE!!!". I'm wondering if it relates to running operations in …

ios cocoa-touch objective-c-blocks nsoperation nsoperationqueue