• 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
inserting graphics into NSString output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inserting graphics into NSString output


  • Subject: inserting graphics into NSString output
  • From: Nathan Lee <email@hidden>
  • Date: Sat, 11 May 2002 19:51:56 -0700

Hello, I'm a newbie, and I'm trying to learn the NSString system. Could
someone help me out with inserting an image into a string?
My program has call that outputs to an NSTextView (called "textBox"
here):

int result;
[textBox insertText: [NSString stringWithFormat:@"The result is: %d\n",
result]];

and I need to insert an NSTextAttachment into the string, just like I'm
inserting an int. I imagine it would look something like this:

int result;
NSTextAttachment *pictureFile;
pictureFile = [[NSTextAttachment alloc] init];
// or this might need [[NSTextAttachment alloc]
initWithFileWrapper:<<something>>]; but I don't know file wrappers yet!

[textBox insertText: [NSString stringWithFormat:@"%a The result is:
%d\n", pictureFile result]];

So, any tips?

--


. ''~``
. ( o o )
+-oooO--(_)--Oooo-------------------------------------------+
| Nathan C. Lee |
| |
| email@hidden |
| (513) 706-5950 |
| oooO |
| ( ) Oooo "Life is short. Make fun of it." |
+--\ (-----( )--------------------------------------------+
. \_) ) /
. (_/
_______________________________________________
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: inserting graphics into NSString output
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Re: Document with multiple windows
  • Next by Date: Re: Line width in an NSBezierPath
  • Previous by thread: Re: Drawing an underline like the one used to indicate spelling errors?
  • Next by thread: Re: inserting graphics into NSString output
  • Index(es):
    • Date
    • Thread