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

前端 未结 4 1111
失恋的感觉
失恋的感觉 2021-02-14 13:51

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:12

    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".

提交回复
热议问题