• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Simple question: Why does this work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple question: Why does this work?


  • Subject: Re: Simple question: Why does this work?
  • From: Nick Zitzmann <email@hidden>
  • Date: Wed, 20 Aug 2003 15:22:10 -0700

On Wednesday, August 20, 2003, at 02:56 PM, Sean Todd wrote:

NSMutableAttributedString* theString = [[[NSMutableAttributedString
alloc] init] autorelease];

[theString setString:@"Hello"];
[theString appendString:@"."];

// pass the theString off to be displayed ...

Why does this work? According to the docs, the setString: and
appendString: methods are instance methods for NSMutableString and I
should have to write:

It works because NSMutableAttributedString is a subclass of NSAttributedString. So it inherits everything from NSAttributedString...

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://seiryu.home.comcast.net/

"I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." - Bjarne Stroustrup
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Simple question: Why does this work?
      • From: Andreas Mayer <email@hidden>
References: 
 >Simple question: Why does this work? (From: Sean Todd <email@hidden>)

  • Prev by Date: Re: Applying text attributes in Cocoa
  • Next by Date: Re: NSOutlineView question
  • Previous by thread: Simple question: Why does this work?
  • Next by thread: Re: Simple question: Why does this work?
  • Index(es):
    • Date
    • Thread