FROM : Stéphane Sudre
DATE : Thu May 01 18:38:03 2008
On May 1, 2008, at 4:51 PM, Luong Dang wrote:
> Hi all,
>
> I'm having a problem with NSTextView: I programmatically insert an
> image attachment into an NSTextView. However, when I delete the
> text from my GUI the image didn't go away, even though from the
> code, I can see that NSAttachmentCharacter is removed from my
> attributed string.
>
> Here's the code I'm using:
>
> NSFileWrapper * fw = [[NSFileWrapper alloc]
> initWithPath:@"somefile.gif"];
> NSTextAttachment * attachment = [[NSTextAttachment alloc]
> initWithFileWrapper:fw];
> NSAttributedString * string = [NSAttributedString
> attributedStringWithAttachment:attachment];
>
> [[textView textStorage] appendAttributedString: string];
>
> Some additional info if they help:
> * The image is an animated gif file
> * I use automatic garbage collection - could it be that GC is not
> finalizing my objects in time?
How do you delete the text? Code or keyboard?
Couldn't it just be a refresh missing?
DATE : Thu May 01 18:38:03 2008
On May 1, 2008, at 4:51 PM, Luong Dang wrote:
> Hi all,
>
> I'm having a problem with NSTextView: I programmatically insert an
> image attachment into an NSTextView. However, when I delete the
> text from my GUI the image didn't go away, even though from the
> code, I can see that NSAttachmentCharacter is removed from my
> attributed string.
>
> Here's the code I'm using:
>
> NSFileWrapper * fw = [[NSFileWrapper alloc]
> initWithPath:@"somefile.gif"];
> NSTextAttachment * attachment = [[NSTextAttachment alloc]
> initWithFileWrapper:fw];
> NSAttributedString * string = [NSAttributedString
> attributedStringWithAttachment:attachment];
>
> [[textView textStorage] appendAttributedString: string];
>
> Some additional info if they help:
> * The image is an animated gif file
> * I use automatic garbage collection - could it be that GC is not
> finalizing my objects in time?
How do you delete the text? Code or keyboard?
Couldn't it just be a refresh missing?
| Related mails | Author | Date |
|---|---|---|
| Luong Dang | May 1, 16:51 | |
| Stéphane Sudre | May 1, 18:38 | |
| Luong Dang | May 3, 17:25 |






Cocoa mail archive

