NSOpenPanel 讀檔視窗的用法

Leave a Comment

  
  
    NSOpenPanel *openPanel = [NSOpenPanel openPanel];   //簡單的宣告方式 不用release

    [openPanel setCanChooseDirectories:TRUE];   //  最後選擇的檔案可以是資料夾
    [openPanel setCanChooseFiles:TRUE];         //  最後選擇的檔案可以是檔案
  
    if ([openPanel runModal] == NSOKButton) {
        NSLog(@"%@",[openPanel URL]);
    }
   


0 意見:

張貼留言

技術提供:Blogger.