1. Stewart Mackenzie
  2. cappuccino-docs

Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_object_8j_source.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Mirrored from cappuccino.org/learn/documentation/_c_p_object_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:42 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: Foundation/CPObject.j Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>Foundation/CPObject.j</h1><a href="_c_p_object_8j.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * CPObject.j</span>
<a name="l00003"></a>00003 <span class="comment"> * Foundation</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Created by Francisco Tolmasky.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2008, 280 North, Inc.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00009"></a>00009 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00010"></a>00010 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00011"></a>00011 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00016"></a>00016 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00019"></a>00019 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022 
<a name="l00064"></a>00064 <span class="keyword">@implementation </span><a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066     Class   <a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>;
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068 
<a name="l00069"></a>00069 + (void)load
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071 }
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 + (void)initialize
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075 <span class="comment">//    CPLog(&quot;calling initialize &quot;+self.name);</span>
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077 
<a name="l00082"></a>00082 + (id)new
<a name="l00083"></a>00083 {
<a name="l00084"></a>00084     <span class="keywordflow">return</span> [[<span class="keyword">self</span> alloc] init];
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086 
<a name="l00090"></a>00090 + (id)alloc
<a name="l00091"></a>00091 {
<a name="l00092"></a>00092 <span class="comment">//    CPLog(&quot;calling alloc on &quot; + self.name + &quot;.&quot;);</span>
<a name="l00093"></a>00093     <span class="keywordflow">return</span> class_createInstance(<span class="keyword">self</span>);
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 + (id)allocWithCoder:(<a class="code" href="class_c_p_coder.html" title="Defines methods for use when archiving &amp;amp; restoring (enc/decoding).">CPCoder</a>)aCoder
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098     <span class="keywordflow">return</span> [<span class="keyword">self</span> alloc];
<a name="l00099"></a>00099 }
<a name="l00100"></a>00100 
<a name="l00105"></a>00105 - (id)init
<a name="l00106"></a>00106 {
<a name="l00107"></a>00107     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109 
<a name="l00114"></a>00114 - (id)copy
<a name="l00115"></a>00115 {
<a name="l00116"></a>00116     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00117"></a>00117 }
<a name="l00118"></a>00118 
<a name="l00123"></a>00123 - (id)mutableCopy
<a name="l00124"></a>00124 {
<a name="l00125"></a>00125     <span class="keywordflow">return</span> [<span class="keyword">self</span> copy];
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127 
<a name="l00131"></a>00131 - (void)dealloc
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 }
<a name="l00134"></a>00134 
<a name="l00135"></a>00135 <span class="comment">// Identifying classes</span>
<a name="l00139"></a>00139 <span class="comment"></span>+ (Class)class
<a name="l00140"></a>00140 {
<a name="l00141"></a>00141     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00142"></a>00142 }
<a name="l00143"></a>00143 
<a name="l00147"></a>00147 - (Class)class
<a name="l00148"></a>00148 {
<a name="l00149"></a>00149     <span class="keywordflow">return</span> <a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 
<a name="l00155"></a>00155 + (Class)superclass
<a name="l00156"></a>00156 {
<a name="l00157"></a>00157     <span class="keywordflow">return</span> super_class;
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 
<a name="l00164"></a>00164 + (BOOL)isSubclassOfClass:(Class)aClass
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166     var theClass = <span class="keyword">self</span>;
<a name="l00167"></a>00167     
<a name="l00168"></a>00168     <span class="keywordflow">for</span>(; theClass; theClass = theClass.super_class)
<a name="l00169"></a>00169         <span class="keywordflow">if</span>(theClass === aClass)
<a name="l00170"></a>00170             <span class="keywordflow">return</span> YES;
<a name="l00171"></a>00171     
<a name="l00172"></a>00172     <span class="keywordflow">return</span> NO;
<a name="l00173"></a>00173 }
<a name="l00174"></a>00174 
<a name="l00179"></a>00179 - (BOOL)isKindOfClass:(Class)aClass
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181     <span class="keywordflow">return</span> [isa isSubclassOfClass:aClass];
<a name="l00182"></a>00182 }
<a name="l00183"></a>00183 
<a name="l00184"></a>00184 + (BOOL)isKindOfClass:(Class)aClass
<a name="l00185"></a>00185 {
<a name="l00186"></a>00186     <span class="keywordflow">return</span> [<span class="keyword">self</span> isSubclassOfClass:aClass];
<a name="l00187"></a>00187 }
<a name="l00188"></a>00188 
<a name="l00193"></a>00193 - (BOOL)isMemberOfClass:(Class)aClass
<a name="l00194"></a>00194 {
<a name="l00195"></a>00195     <span class="keywordflow">return</span> <span class="keyword">self</span>.isa === aClass;
<a name="l00196"></a>00196 }
<a name="l00197"></a>00197 
<a name="l00198"></a>00198 + (BOOL)isMemberOfClass:(Class)aClass
<a name="l00199"></a>00199 {
<a name="l00200"></a>00200     <span class="keywordflow">return</span> <span class="keyword">self</span> === aClass;
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 
<a name="l00207"></a>00207 - (BOOL)isProxy
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209     <span class="keywordflow">return</span> NO;
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211 
<a name="l00212"></a>00212 <span class="comment">// Testing class functionality</span>
<a name="l00218"></a>00218 <span class="comment"></span>+ (BOOL)instancesRespondToSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00219"></a>00219 {
<a name="l00220"></a>00220     <span class="keywordflow">return</span> !!class_getInstanceMethod(<span class="keyword">self</span>, aSelector);
<a name="l00221"></a>00221 }
<a name="l00222"></a>00222 
<a name="l00228"></a>00228 - (BOOL)respondsToSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230     <span class="comment">// isa is isa.isa in class case.</span>
<a name="l00231"></a>00231     <span class="keywordflow">return</span> !!class_getInstanceMethod(<a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>, aSelector);
<a name="l00232"></a>00232 }
<a name="l00233"></a>00233 
<a name="l00234"></a>00234 <span class="comment">// Obtaining method information</span>
<a name="l00235"></a>00235 
<a name="l00241"></a>00241 - (IMP)methodForSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00242"></a>00242 {
<a name="l00243"></a>00243     <span class="keywordflow">return</span> class_getMethodImplementation(<a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>, aSelector);
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245 
<a name="l00251"></a>00251 + (IMP)instanceMethodForSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00252"></a>00252 {
<a name="l00253"></a>00253     <span class="keywordflow">return</span> class_getMethodImplementation(<span class="keyword">self</span>, aSelector);
<a name="l00254"></a>00254 }
<a name="l00255"></a>00255 
<a name="l00261"></a>00261 - (CPMethodSignature)methodSignatureForSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00262"></a>00262 {
<a name="l00263"></a>00263     <span class="comment">// FIXME: We need to implement method signatures.</span>
<a name="l00264"></a>00264     <span class="keywordflow">return</span> nil;
<a name="l00265"></a>00265 }
<a name="l00266"></a>00266 
<a name="l00267"></a>00267 <span class="comment">// Describing objects</span>
<a name="l00271"></a>00271 <span class="comment"></span>- (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)description
<a name="l00272"></a>00272 {
<a name="l00273"></a>00273     <span class="keywordflow">return</span> <span class="stringliteral">&quot;&lt;&quot;</span> + class_getName(<a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>) + &quot; 0x&quot; + [<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a> stringWithHash:[self UID]] + &quot;&gt;&quot;;
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275 
<a name="l00276"></a>00276 + (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)description
<a name="l00277"></a>00277 {
<a name="l00278"></a>00278     <span class="keywordflow">return</span> class_getName(<a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>);
<a name="l00279"></a>00279 }
<a name="l00280"></a>00280 
<a name="l00281"></a>00281 <span class="comment">// Sending Messages</span>
<a name="l00287"></a>00287 <span class="comment"></span>- (id)performSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00288"></a>00288 {
<a name="l00289"></a>00289     <span class="keywordflow">return</span> objj_msgSend(<span class="keyword">self</span>, aSelector);
<a name="l00290"></a>00290 }
<a name="l00291"></a>00291 
<a name="l00298"></a>00298 - (id)performSelector:(<span class="keywordtype">SEL</span>)aSelector withObject:(<span class="keywordtype">id</span>)anObject
<a name="l00299"></a>00299 {
<a name="l00300"></a>00300     <span class="keywordflow">return</span> objj_msgSend(<span class="keyword">self</span>, aSelector, anObject);
<a name="l00301"></a>00301 }
<a name="l00302"></a>00302 
<a name="l00310"></a>00310 - (id)performSelector:(<span class="keywordtype">SEL</span>)aSelector withObject:(<span class="keywordtype">id</span>)anObject withObject:(<span class="keywordtype">id</span>)anotherObject
<a name="l00311"></a>00311 {
<a name="l00312"></a>00312     <span class="keywordflow">return</span> objj_msgSend(<span class="keyword">self</span>, aSelector, anObject, anotherObject);
<a name="l00313"></a>00313 }
<a name="l00314"></a>00314 
<a name="l00315"></a>00315 <span class="comment">// Forwarding Messages</span>
<a name="l00322"></a>00322 <span class="comment"></span>- (void)forwardInvocation:(<a class="code" href="class_c_p_invocation.html" title="An object representation of a message.">CPInvocation</a>)anInvocation
<a name="l00323"></a>00323 {
<a name="l00324"></a>00324     [<span class="keyword">self</span> doesNotRecognizeSelector:[anInvocation <a class="code" href="class_c_p_invocation.html#a59a413962fbf295fa620f995268bd447">selector</a>]];
<a name="l00325"></a>00325 }
<a name="l00326"></a>00326 
<a name="l00331"></a>00331 <span class="comment">// FIXME: This should be moved to the runtime?</span>
<a name="l00332"></a>00332 - (void)forward:(<span class="keywordtype">SEL</span>)aSelector :(marg_list)args
<a name="l00333"></a>00333 {
<a name="l00334"></a>00334     var signature = [<span class="keyword">self</span> methodSignatureForSelector:aSelector];
<a name="l00335"></a>00335     
<a name="l00336"></a>00336     <span class="keywordflow">if</span> (signature)
<a name="l00337"></a>00337     {
<a name="l00338"></a>00338         invocation = [<a class="code" href="class_c_p_invocation.html" title="An object representation of a message.">CPInvocation</a> <a class="code" href="class_c_p_invocation.html#a20402bebee4ed442290d998d2a0e0b26">invocationWithMethodSignature</a>:signature];
<a name="l00339"></a>00339         
<a name="l00340"></a>00340         [invocation setTarget:self];
<a name="l00341"></a>00341         [invocation setSelector:aSelector];
<a name="l00342"></a>00342         
<a name="l00343"></a>00343         var index = 2,
<a name="l00344"></a>00344             count = args.length;
<a name="l00345"></a>00345             
<a name="l00346"></a>00346         <span class="keywordflow">for</span> (; index &lt; count; ++index)
<a name="l00347"></a>00347             [invocation setArgument:args[index] atIndex:index];
<a name="l00348"></a>00348         
<a name="l00349"></a>00349         [<span class="keyword">self</span> forwardInvocation:invocation];
<a name="l00350"></a>00350         
<a name="l00351"></a>00351         <span class="keywordflow">return</span> [invocation returnValue];
<a name="l00352"></a>00352     }
<a name="l00353"></a>00353     
<a name="l00354"></a>00354     [<span class="keyword">self</span> doesNotRecognizeSelector:aSelector];
<a name="l00355"></a>00355 }
<a name="l00356"></a>00356 
<a name="l00357"></a>00357 <span class="comment">// Error Handling</span>
<a name="l00363"></a>00363 <span class="comment"></span>- (void)doesNotRecognizeSelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00364"></a>00364 {
<a name="l00365"></a>00365     [<a class="code" href="class_c_p_exception.html" title="Used to implement exception handling (creating &amp;amp; raising).">CPException</a> <a class="code" href="class_c_p_exception.html#ac8f34bd11868822e26a7b952810128b8">raise</a>:CPInvalidArgumentException <a class="code" href="class_c_p_exception.html#ac8f34bd11868822e26a7b952810128b8">reason</a>:
<a name="l00366"></a>00366         (class_isMetaClass(isa) ? &quot;+&quot; : &quot;-&quot;) + &quot; [&quot; + [<span class="keyword">self</span> className] + &quot; &quot; + aSelector + &quot;] unrecognized selector sent to &quot; +
<a name="l00367"></a>00367         (class_isMetaClass(isa) ? &quot;class&quot; : &quot;instance&quot;) + &quot; 0x&quot; + [<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a> <a class="code" href="class_c_p_string.html#a8cfed134036d37dc7bf80abd9086c57d">stringWithHash</a>:[<span class="keyword">self</span> UID]]];
<a name="l00368"></a>00368 }
<a name="l00369"></a>00369 
<a name="l00370"></a>00370 <span class="comment">// Archiving</span>
<a name="l00379"></a>00379 <span class="comment"></span>- (id)awakeAfterUsingCoder:(<a class="code" href="class_c_p_coder.html" title="Defines methods for use when archiving &amp;amp; restoring (enc/decoding).">CPCoder</a>)aCoder
<a name="l00380"></a>00380 {
<a name="l00381"></a>00381     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00382"></a>00382 }
<a name="l00383"></a>00383 
<a name="l00388"></a>00388 - (Class)classForKeyedArchiver
<a name="l00389"></a>00389 {
<a name="l00390"></a>00390     <span class="keywordflow">return</span> [<span class="keyword">self</span> classForCoder];
<a name="l00391"></a>00391 }
<a name="l00392"></a>00392 
<a name="l00397"></a>00397 - (Class)classForCoder
<a name="l00398"></a>00398 {
<a name="l00399"></a>00399     <span class="keywordflow">return</span> [<span class="keyword">self</span> class];
<a name="l00400"></a>00400 }
<a name="l00401"></a>00401 
<a name="l00407"></a>00407 - (id)replacementObjectForArchiver:(CPArchiver)anArchiver
<a name="l00408"></a>00408 {
<a name="l00409"></a>00409     <span class="keywordflow">return</span> [<span class="keyword">self</span> replacementObjectForCoder:anArchiver];
<a name="l00410"></a>00410 }
<a name="l00411"></a>00411 
<a name="l00417"></a>00417 - (id)replacementObjectForKeyedArchiver:(<a class="code" href="class_c_p_keyed_archiver.html" title="Implements keyed archiving of object graphs (e.g. for storing data).">CPKeyedArchiver</a>)anArchiver
<a name="l00418"></a>00418 {
<a name="l00419"></a>00419     <span class="keywordflow">return</span> [<span class="keyword">self</span> replacementObjectForCoder:anArchiver];
<a name="l00420"></a>00420 }
<a name="l00421"></a>00421 
<a name="l00427"></a>00427 - (id)replacementObjectForCoder:(<a class="code" href="class_c_p_coder.html" title="Defines methods for use when archiving &amp;amp; restoring (enc/decoding).">CPCoder</a>)aCoder
<a name="l00428"></a>00428 {
<a name="l00429"></a>00429     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00430"></a>00430 }
<a name="l00431"></a>00431 
<a name="l00436"></a>00436 + (id)setVersion:(<span class="keywordtype">int</span>)aVersion
<a name="l00437"></a>00437 {
<a name="l00438"></a>00438     version = aVersion;
<a name="l00439"></a>00439     
<a name="l00440"></a>00440     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00441"></a>00441 }
<a name="l00442"></a>00442 
<a name="l00446"></a>00446 + (int)version
<a name="l00447"></a>00447 {
<a name="l00448"></a>00448     <span class="keywordflow">return</span> version;
<a name="l00449"></a>00449 }
<a name="l00450"></a>00450 
<a name="l00451"></a>00451 <span class="comment">// Scripting (?)</span>
<a name="l00455"></a>00455 <span class="comment"></span>- (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)className
<a name="l00456"></a>00456 {
<a name="l00457"></a>00457     <span class="keywordflow">return</span> <a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>.name;
<a name="l00458"></a>00458 }
<a name="l00459"></a>00459 
<a name="l00460"></a>00460 <span class="comment">// Extras</span>
<a name="l00465"></a>00465 <span class="comment"></span>- (id)autorelease
<a name="l00466"></a>00466 {
<a name="l00467"></a>00467     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00468"></a>00468 }
<a name="l00469"></a>00469 
<a name="l00473"></a>00473 - (unsigned)hash
<a name="l00474"></a>00474 {
<a name="l00475"></a>00475     <span class="keywordflow">return</span> [<span class="keyword">self</span> UID];
<a name="l00476"></a>00476 }
<a name="l00477"></a>00477 
<a name="l00478"></a>00478 - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)UID
<a name="l00479"></a>00479 {
<a name="l00480"></a>00480     <span class="keywordflow">if</span> (typeof <span class="keyword">self</span>._UID === <span class="stringliteral">&quot;undefined&quot;</span>)
<a name="l00481"></a>00481         <span class="keyword">self</span>._UID = objj_generateObjectUID();
<a name="l00482"></a>00482 
<a name="l00483"></a>00483     <span class="keywordflow">return</span> _UID + &quot;&quot;;
<a name="l00484"></a>00484 }
<a name="l00485"></a>00485 
<a name="l00490"></a>00490 - (BOOL)isEqual:(<span class="keywordtype">id</span>)anObject
<a name="l00491"></a>00491 {
<a name="l00492"></a>00492     <span class="keywordflow">return</span> <span class="keyword">self</span> === anObject || [<span class="keyword">self</span> UID] === [anObject UID];
<a name="l00493"></a>00493 }
<a name="l00494"></a>00494 
<a name="l00499"></a>00499 - (id)retain
<a name="l00500"></a>00500 {
<a name="l00501"></a>00501     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00502"></a>00502 }
<a name="l00503"></a>00503 
<a name="l00507"></a>00507 - (void)release
<a name="l00508"></a>00508 {
<a name="l00509"></a>00509 }
<a name="l00510"></a>00510 
<a name="l00514"></a>00514 - (id)<a class="code" href="_c_p_button_bar_8j.html#a57945218a0d2fdfc4a2d4fa646901ef1">self</a>
<a name="l00515"></a>00515 {
<a name="l00516"></a>00516     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00517"></a>00517 }
<a name="l00518"></a>00518 
<a name="l00522"></a>00522 - (Class)superclass
<a name="l00523"></a>00523 {
<a name="l00524"></a>00524     <span class="keywordflow">return</span> <a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>.super_class;
<a name="l00525"></a>00525 }
<a name="l00526"></a>00526 
<a name="l00527"></a>00527 <span class="keyword">@end</span>
<a name="l00528"></a>00528 
<a name="l00529"></a>00529 <span class="comment">// override toString on Objective-J objects so we get the actual description of the object</span>
<a name="l00530"></a>00530 <span class="comment">// when coerced to a string, instead of &quot;[Object object]&quot;</span>
<a name="l00531"></a>00531 objj_class.prototype.toString = objj_object.prototype.toString = function()
<a name="l00532"></a>00532 {
<a name="l00533"></a>00533     <span class="keywordflow">if</span> (this.<a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a> &amp;&amp; class_getInstanceMethod(this.<a class="code" href="_c_p_array_8j.html#a702f174ccd5ff8e1139f8657a0bba6fd">isa</a>, <span class="stringliteral">&quot;description&quot;</span>) != NULL)
<a name="l00534"></a>00534         <span class="keywordflow">return</span> [this description]
<a name="l00535"></a>00535     <span class="keywordflow">else</span>
<a name="l00536"></a>00536         <span class="keywordflow">return</span> String(<span class="keyword">this</span>) + &quot; (-description not implemented)&quot;;
<a name="l00537"></a>00537 }
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:32:57 2010 for Cappuccino API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>

<!-- Mirrored from cappuccino.org/learn/documentation/_c_p_object_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:42 GMT -->
</html>