Pointer on a document (suite)

  • I am trying to achieve the following thing :
    In a class, I want to create a document and "write" NSString with the
    "insertText" method.
    I create this document with : [NSApp sendAction:@selector
    (newDocument:) to:nil from:self] but to use "insertText" on it, I
    need to recover a pointer on the created document.
    How can I recover the pointer on the document created with [NSApp
    sendAction:@selector(newDocument:) to:nil from:self] ?

    Eric PETIT
  • On Jan 19, 2008, at 1:11 PM, Eric PETIT wrote:
    > I am trying to achieve the following thing :
    > In a class, I want to create a document and "write" NSString with
    > the "insertText" method.
    > I create this document with : [NSApp
    > sendAction:@selector(newDocument:) to:nil from:self] but to use
    > "insertText" on it, I need to recover a pointer on the created
    > document.
    > How can I recover the pointer on the document created with [NSApp
    > sendAction:@selector(newDocument:) to:nil from:self] ?
    >
    You don't.
    Assuming you're using the document architecture, you create a new
    document instance using the shared NSDocumentController instance and,
    for example, openUntitledDocumentAndDisplay:error:.

    mmalc
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today