Professional Web Applications Themes

new question on getting a filename from a sheet - Mac Programming

Can anyone help on figuring out what should be called in order to get the selected filename from this sheet panel? Any help much appreciated. --- .... [panel beginSheetForDirectory:NSHomeDirectory() file:"" types:fileTypes modalForWindow:projectWindow modalDelegate:self didEndSelector:selector(filePanelDidEnd:returnCod e:contextInfo:) contextInfo:nil]; // which calls this ... - (void)filePanelDidEnd:(NSWindow*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo { // i think this used to be [sheet filename], but filename is no longer used. NSString * filename = [sheet representedFilename]; NSLog("filename = %", filename); .... My filename is always null....

  1. #1

    Default new question on getting a filename from a sheet

    Can anyone help on figuring out what should be called in order to get
    the selected filename from this sheet panel?

    Any help much appreciated.

    ---
    ....
    [panel beginSheetForDirectory:NSHomeDirectory()
    file:"" types:fileTypes
    modalForWindow:projectWindow
    modalDelegate:self
    didEndSelector:selector(filePanelDidEnd:returnCod e:contextInfo:)
    contextInfo:nil];

    // which calls this ...

    - (void)filePanelDidEnd:(NSWindow*)sheet
    returnCode:(int)returnCode
    contextInfo:(void*)contextInfo
    {

    // i think this used to be [sheet filename], but filename is no longer
    used.

    NSString * filename = [sheet representedFilename];
    NSLog("filename = %", filename);
    ....

    My filename is always null.
    Willian Guest

  2. #2

    Default Re: new question on getting a filename from a sheet

    In article <google.com>,
    com (Willian Irving Zumwalt) wrote:
     

    [snip code]
     

    What makes you say that it is no longer used? I use it, and it works ok
    for me.
    Michael Guest

  3. #3

    Default Re: new question on getting a filename from a sheet

    > What makes you say that it is no longer used? I use it, and it works ok 

    Ok, I mis-stated that. I just don't understand why I get this message as a warning.

    ProjectController.mm:65: `NSWindow' does not respond to `filename'
    Willian Guest

  4. #4

    Default Re: new question on getting a filename from a sheet

    In article <google.com>,
    com (Willian Irving Zumwalt) wrote:
     
    >
    > Ok, I mis-stated that. I just don't understand why I get this message as a
    > warning.
    >
    > ProjectController.mm:65: `NSWindow' does not respond to `filename'[/ref]

    It looks like you're defining your panel as an NSWindow. Declare it as
    an NSOpenPanel, or as an id.
    Michael Guest

Similar Threads

  1. Print 8.5 x 11 sheet
    By stubert webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 2
    Last Post: February 13th, 04:23 PM
  2. Replies: 4
    Last Post: December 20th, 01:20 AM
  3. excel sheet in the web- how?
    By fs in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 31st, 08:33 PM
  4. FM XML to EXCEL Style Sheet Question
    By Martti Humppi in forum FileMaker
    Replies: 0
    Last Post: July 31st, 08:21 AM
  5. alert sheet after NSOpenPanel sheet
    By James W. Walker in forum Mac Programming
    Replies: 3
    Last Post: July 14th, 10:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139