Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dispatch_release compiler error when upgrading deployment target

I'm told to upgrade the deployment target of an iOS app from iOS 5.1.1 to iOS 6.0. I had several dispatch_queue_t variables in code with corresponding dispatch_release function calls. Compiler did not complain until now that I've raised the deployment target.

I've read several posts related to this (e.g. Does ARC support dispatch queues?) where it is said that dispatch_release is not needed anymore starting from iOS 6.0, but... do I need to replace such function call with another, or have I simply to remove them?

Thanks

like image 955
AppsDev Avatar asked May 07 '26 21:05

AppsDev


1 Answers

Basically, you can simply remove them. Compiler does automatically emit code to release dispatch queues and other GCD objects as Objective-C objects. You might need to modify a bit to release dispatch queues if there is retain cycle.

Or you can keep dispatch_release calling with -DOS_OBJECT_USE_OBJC=0 compiler flag as you read.

like image 103
Kazuki Sakamoto Avatar answered May 10 '26 09:05

Kazuki Sakamoto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!