<font face="tahoma,sans-serif">Not at all, I am only looking to add compile-time verification of the developer's intent that they wish to override a particular method.</font><div><font class="Apple-style-span" face="tahoma, sans-serif"><br>
</font></div><div><font face="tahoma,sans-serif"></font><font class="Apple-style-span" face="tahoma, sans-serif">In the example below, the fictitious developer has derived from UIViewController<UITableViewDataSource>, and intended to override / implement the numberOfSectionsInTableView method from the UITableViewDataSource protocol.  The subtle issue is they have misspelled the method as numberOfSectionsInTable<b><font class="Apple-style-span" color="#FF0000">v</font></b>iew, however as the method is marked @optional, the compiler issues no warning.  By adding support for "override", we would force the compiler to walk the inheritance and protocol hierarchy and issue a warning if the method marked as override was not found.  It is not changing the behavior of Obj-C or the runtime in anyway.</font></div>
<div><font class="Apple-style-span" face="tahoma, sans-serif"><br></font></div><div><font class="Apple-style-span" face="tahoma, sans-serif">Cheers,</font></div><div><font class="Apple-style-span" face="tahoma, sans-serif"><br>
</font></div><div><font class="Apple-style-span" face="tahoma, sans-serif">Stu</font></div><div><font class="Apple-style-span" face="tahoma, sans-serif"><br></font><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(80, 0, 80)"><strong><span style="color:rgb(153, 204, 255)">Stuart Carnie, CTO</span></strong><br>
<span style="color:rgb(255, 102, 0)"><strong><a href="http://manomio.com/" style="color:rgb(255, 102, 0)" target="_blank">manomio</a> | in retro we trust!</strong></span></span><br>
<br><br><div class="gmail_quote">On Mon, Nov 29, 2010 at 6:13 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com">clattner@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><br><div><div class="im"><div>On Nov 29, 2010, at 4:09 PM, Stuart Carnie wrote:</div><br></div><div class="im"><blockquote type="cite"><font face="tahoma,sans-serif">Hi all,</font><div><font face="tahoma,sans-serif"><br>
</font></div><div><font face="tahoma,sans-serif">I would like to have a go at hacking a little on Clang when a get a bit of spare time, and have found that adding support for override would be useful little exercise.  I've seen another post referring to Clang's support for __attribute__((override)), and seems like I could use this as a starting point.</font></div>

<div><font face="tahoma,sans-serif"><br></font></div><div><font face="tahoma,sans-serif"><a href="http://weblog.bignerdranch.com/?p=171" target="_blank">Big Nerd Ranch</a> would like to see an @override keyword, as follows:</font></div>
<div>
<font face="tahoma,sans-serif"><br></font></div><div><font face="tahoma,sans-serif"><span style="font-family:Verdana, Tahoma, Arial, sans-serif;font-size:12px;color:rgb(48, 48, 48);line-height:19px"><pre style="margin-top:0px;margin-right:0px;margin-bottom:10px;margin-left:0px;padding-top:5px;padding-right:5px;padding-bottom:5px;padding-left:5px;font-family:Courier;font-size:1.2em;width:672px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-width:initial;border-color:initial;border-top-width:thin;border-right-width:thin;border-bottom-width:thin;border-left-width:thin">
@override
- (NSInteger)numberOfSectionsInTableview:(UITableView *)tv
{ ... }</pre></span></font></div></blockquote><br></div></div><div>Hi Stuart,</div><div><br></div><div>Is your  goal here to allow overloading of ObjC methods?  If so, the parsing isn't the hard part, you'd need to mangle selectors somehow, and enhance the runtime to support this.  This isn't something we want in ObjC, because want to keep it simple.</div>
<div><br></div><font color="#888888"><div>-Chris</div><br></font></div></blockquote></div><br></div></div>