Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to release a block

I am storing my blocks while my web service goes off and talks to my server. Therefore I am using [myBlock copy] to keep a reference to my block.

Once I have got my data, and executed the block, do I call [myBlock release], or do I use Block_release(myBlock) ? I can find reference to both.

like image 953
Marc Avatar asked Apr 23 '12 08:04

Marc


1 Answers

Block_release() is there for when you're only using blocks in C, and not Objective-C.

When using Objective-C you can use the release and copy methods to make your code look and feel more like the rest of the ObjC around it.

I imagine they both do exactly the same thing, and that the objc method is just a wrapper around the call to Block_release() anyway.

like image 189
Jasarien Avatar answered Sep 25 '22 18:09

Jasarien