This was a bug in ARC versus the Objective-C runtime.
It has been fixed but I don't think any iOS release has the change yet.
The safest solution is to call objc_allocateProtocol() and objc_registerProtocol() in a non-ARC file.
Your unsafe_unretained fix should also work. Adding an extra call to protocol_getName() is not a reliable fix.
DaidoujiChen/RuntimeProtocolIssue
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
question on stackoverflow http://stackoverflow.com/questions/30002628/add-a-new-class-with-new-protocol-at-runtime-get-different-behavior
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published