<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 30, 2014, at 11:41 AM, Argyrios Kyrtzidis <<a href="mailto:kyrtzidis@apple.com">kyrtzidis@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><blockquote type="cite">On May 30, 2014, at 11:34 AM, Argyrios Kyrtzidis <<a href="mailto:kyrtzidis@apple.com">kyrtzidis@apple.com</a>> wrote:<br><br><br><blockquote type="cite">On May 30, 2014, at 11:13 AM, jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:<br><br>Is this intentional, or a specific case for retain/release methods?<br></blockquote><br>This also returns TRUE:<br><br><span class="Apple-tab-span" style="white-space:pre">    </span>blk b = ^{};<br><span class="Apple-tab-span" style="white-space:pre">      </span>BOOL res = [b respondsToSelector:@selector(isKindOfClass:)];<br><br>So blocks seem to respond to NSObject protocol selectors.<br><br><blockquote type="cite">In generally though it makes no sense<br>to allow qualified id conversion of blocks pointers.<br></blockquote><br>It would make sense for id<NSObject> if we would guarantee that blocks conform to NSObject protocol.<br></blockquote><br>BTW, returns true as well:<br><br><span class="Apple-tab-span" style="white-space:pre">      </span>blk b = ^{};<br><span class="Apple-tab-span" style="white-space:pre">      </span>BOOL res = [b conformsToProtocol:@protocol(NSObject)];<br></blockquote><div><br></div>We should run this by the Foundation people. For example, this also returns 1:</div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">BOOL res = [b respondsToSelector:@selector(dealloc)];</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">But dealloc is not a method of NSObject protocol. But it is a method</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">of NSObject class. It seems more and more that we should make an exception</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">for NSObject as block implements its protocol and class.</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">- Fariborz</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div></div><div><br></div></body></html>