![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>NSAttributedString class reference</title> </head> <body> <font face="serif"> <a href="Base.html">Up</a> <br /> <h1><a name="title$NSAttributedString">NSAttributedString class reference</a></h1> <h3>Authors</h3> <dl> <dt>ANOQ of the sun (<a href="mailto:anoq@vip.cybercity.dk"><code>anoq@vip.cybercity.dk</code></a>)</dt> <dd> </dd> <dt>Richard Frith-Macdonald (<a href="mailto:richard@brainstorm.co.uk"><code>richard@brainstorm.co.uk</code></a>)</dt> <dd> </dd> </dl> <p><b>Copyright:</b> (C) 1997,1999 Free Software Foundation, Inc.</p> <div> <hr width="50%" align="left" /> <h3>Contents -</h3> <ol> <li> <a href="#001000000000">Software documentation for the NSAttributedString class</a> </li> <li> <a href="#002000000000">Software documentation for the NSMutableAttributedString class</a> </li> </ol> <hr width="50%" align="left" /> </div> <h1><a name="001000000000"> Software documentation for the NSAttributedString class </a></h1> <h2><a name="class$NSAttributedString">NSAttributedString</a> : <a rel="gsdoc" href="NSObject.html#class$NSObject">NSObject</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSAttributedString.h</dd> </dl> </blockquote> <blockquote> <dl> <dt><b>Conforms to:</b></dt> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSCoding)">NSCoding</a></dd> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSCopying)">NSCopying</a></dd> <dd><a rel="gsdoc" href="NSObject.html#protocol$(NSMutableCopying)">NSMutableCopying</a></dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> A string in which name-value pairs represented by an <a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a> may be associated to ranges of characters. Used for text rendering by the GUI/AppKit framework, in which fonts, sizes, etc. are stored under standard attributes in the dictionaries. </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-attribute$atIndex$effectiveRange$">-attribute:atIndex:effectiveRange:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-attribute$atIndex$longestEffectiveRange$inRange$">-attribute:atIndex:longestEffectiveRange:inRange:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-attributedSubstringFromRange$">-attributedSubstringFromRange:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-attributesAtIndex$effectiveRange$">-attributesAtIndex:effectiveRange:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-attributesAtIndex$longestEffectiveRange$inRange$">-attributesAtIndex:longestEffectiveRange:inRange:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-initWithAttributedString$">-initWithAttributedString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-initWithString$">-initWithString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-initWithString$attributes$">-initWithString:attributes:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-isEqualToAttributedString$">-isEqualToAttributedString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-length">-length</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSAttributedString-string">-string</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSAttributedString-attribute$atIndex$effectiveRange$">attribute: atIndex: effectiveRange: </a></h3> - (id) <b>attribute:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)attributeName<b> atIndex:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)index<b> effectiveRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>*)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns value for given attribute at <var>index</var>, and, if effectiveRange is non-nil, this gets filled with a range over which this value holds. This may not be the maximum range, depending on the implementation. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-attribute$atIndex$longestEffectiveRange$inRange$">attribute: atIndex: longestEffectiveRange: inRange: </a></h3> - (id) <b>attribute:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)attributeName<b> atIndex:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)index<b> longestEffectiveRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>*)aRange<b> inRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)rangeLimit;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns value for given attribute at <var>index</var>, and, if longestEffectiveRange is non-nil, this gets filled with the range over which the attribute applies, clipped to <var>rangeLimit</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-attributedSubstringFromRange$">attributedSubstringFromRange: </a></h3> - (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*) <b>attributedSubstringFromRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns substring with attribute information. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-attributesAtIndex$effectiveRange$">attributesAtIndex: effectiveRange: </a></h3> - (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>attributesAtIndex:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)index<b> effectiveRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>*)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns attributes and values at <var>index</var>, and, if effectiveRange is non-nil, this gets filled with a range over which these attributes and values still hold. This may not be the maximum range, depending on the implementation. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-attributesAtIndex$longestEffectiveRange$inRange$">attributesAtIndex: longestEffectiveRange: inRange: </a></h3> - (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*) <b>attributesAtIndex:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)index<b> longestEffectiveRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>*)aRange<b> inRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)rangeLimit;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns attributes and values at <var>index</var>, and, if longestEffectiveRange is non-nil, this gets filled with the range over which the attribute-value set is the same as at <var>index</var>, clipped to <var>rangeLimit</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-initWithAttributedString$">initWithAttributedString: </a></h3> - (id) <b>initWithAttributedString:</b> (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*)attributedString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Initialize to copy of <var>attributedString</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-initWithString$">initWithString: </a></h3> - (id) <b>initWithString:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Initialize to <var>aString</var> with no attributes. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-initWithString$attributes$">initWithString: attributes: </a></h3> - (id) <b>initWithString:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aString<b> attributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Initialize to <var>aString</var> with given <var>attributes</var> applying over full range of string. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-isEqualToAttributedString$">isEqualToAttributedString: </a></h3> - (BOOL) <b>isEqualToAttributedString:</b> (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*)otherString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns whether all characters and attributes are equal between this string and <var>otherString</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-length">length </a></h3> - (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>) <b>length</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Return length of the underlying string. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSAttributedString-string">string </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*) <b>string</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns the string content of the receiver. <br /> NB. this is actually a proxy to the internal content (which may change) so if you need an immutable instance you should copy the returned value, not just retain it. <br /> Return the underlying string, stripped of attributes. </div> <hr width="25%" align="left" /> </div> <h1><a name="002000000000"> Software documentation for the NSMutableAttributedString class </a></h1> <h2><a name="class$NSMutableAttributedString">NSMutableAttributedString</a> : <a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a></h2> <blockquote class="declared"> <dl> <dt><b>Declared in:</b></dt> <dd>Foundation/NSAttributedString.h</dd> </dl> </blockquote> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Mutable version of <a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a> . </div> <b>Method summary</b> <ul> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-addAttribute$value$range$">-addAttribute:value:range:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-addAttributes$range$">-addAttributes:range:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-appendAttributedString$">-appendAttributedString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-beginEditing">-beginEditing</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-deleteCharactersInRange$">-deleteCharactersInRange:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-endEditing">-endEditing</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-insertAttributedString$atIndex$">-insertAttributedString:atIndex:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-mutableString">-mutableString</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-removeAttribute$range$">-removeAttribute:range:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-replaceCharactersInRange$withAttributedString$">-replaceCharactersInRange:withAttributedString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-replaceCharactersInRange$withString$">-replaceCharactersInRange:withString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-setAttributedString$">-setAttributedString:</a></li> <li><a rel="gsdoc" href="NSAttributedString.html#method$NSMutableAttributedString-setAttributes$range$">-setAttributes:range:</a></li> </ul> <hr width="50%" align="left" /> <div class="method"> <h3><a name="method$NSMutableAttributedString-addAttribute$value$range$">addAttribute: value: range: </a></h3> - (void) <b>addAttribute:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name<b> value:</b> (id)value<b> range:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Adds attribute applying to given range. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-addAttributes$range$">addAttributes: range: </a></h3> - (void) <b>addAttributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes<b> range:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Add <var>attributes</var> to apply over given range. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-appendAttributedString$">appendAttributedString: </a></h3> - (void) <b>appendAttributedString:</b> (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*)attributedString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Appends attributed string to end of this one, preserving attributes. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-beginEditing">beginEditing </a></h3> - (void) <b>beginEditing</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> An empty method provided for subclasses to override.<br /> <div class="desc"> Call before executing a collection of changes, for optimization. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-deleteCharactersInRange$">deleteCharactersInRange: </a></h3> - (void) <b>deleteCharactersInRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Removes characters and attributes applying to them. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-endEditing">endEditing </a></h3> - (void) <b>endEditing</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> An empty method provided for subclasses to override.<br /> <div class="desc"> Call after executing a collection of changes, for optimization. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-insertAttributedString$atIndex$">insertAttributedString: atIndex: </a></h3> - (void) <b>insertAttributedString:</b> (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*)attributedString<b> atIndex:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSUInteger">NSUInteger</a>)index;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Inserts attributed string within this one, preserving attributes. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-mutableString">mutableString </a></h3> - (<a rel="gsdoc" href="NSString.html#class$NSMutableString">NSMutableString</a>*) <b>mutableString</b>;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Returns mutable version of the underlying string. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-removeAttribute$range$">removeAttribute: range: </a></h3> - (void) <b>removeAttribute:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)name<b> range:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Removes given attribute from <var>aRange</var>. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-replaceCharactersInRange$withAttributedString$">replaceCharactersInRange: withAttributedString: </a></h3> - (void) <b>replaceCharactersInRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange<b> withAttributedString:</b> (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*)attributedString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Replaces substring and attributes. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-replaceCharactersInRange$withString$">replaceCharactersInRange: withString: </a></h3> - (void) <b>replaceCharactersInRange:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange<b> withString:</b> (<a rel="gsdoc" href="NSString.html#class$NSString">NSString</a>*)aString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> Subclasses <strong>must</strong> override this method.<br /> <div class="desc"> Replaces substring; replacement is granted attributes equal to those of the first character of the portion replaced. </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-setAttributedString$">setAttributedString: </a></h3> - (void) <b>setAttributedString:</b> (<a rel="gsdoc" href="#class$NSAttributedString">NSAttributedString</a>*)attributedString;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Replaces entire contents (so this object can be reused). </div> <hr width="25%" align="left" /> </div> <div class="method"> <h3><a name="method$NSMutableAttributedString-setAttributes$range$">setAttributes: range: </a></h3> - (void) <b>setAttributes:</b> (<a rel="gsdoc" href="NSDictionary.html#class$NSDictionary">NSDictionary</a>*)attributes<b> range:</b> (<a rel="gsdoc" href="TypesAndConstants.html#type$NSRange">NSRange</a>)aRange;<br /> <div class="availability"> <b>Availability:</b> MacOS-X 10.0.0</div> <br /> <div class="desc"> Sets <var>attributes</var> to apply over range, replacing any previous <var>attributes</var>. </div> <hr width="25%" align="left" /> </div> <br /> <a href="Base.html">Up</a> </font> </body> </html>