iOS 5 Twitter Framework & completionHandler block - “Capturing 'self' strongly in this block is likely to lead to a retain cycle”

前端 未结 4 1232
后悔当初
后悔当初 2021-02-14 13:34

I am very new to programming and Objective-C and I am trying to work out what is wrong with my code. I have read a bit about blocks but I don\'t know how any of what I have read

4条回答
  •  执念已碎
    2021-02-14 14:15

    There is a rather surprising way to get rid of the warning. Mind you, only do this if you are sure you are not creating a retain cycle, or you are sure that you will break it yourself later on (by setting the completion handler to nil when you're done, for example). If you have control over the interface, then rename your method so it does not start with "set". The compiler seems to give this warning only when the method name starts with "set".

提交回复
热议问题