Açık bir paneli bu şekilde kayan bir pencere olarak görüntülüyorum.NSOpenPanel Sheet
Birisi paneli panel olarak çalıştırırken bana yardımcı olabilir mi? Pencere nesnesi mWindow. Kullandığım standart kodların çoğu amortismana tabi tutuluyor.
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
NSArray* fileTypes = [[NSArray alloc] initWithObjects:@"mp3", @"mp2", @"m4a", nil];
[openPanel setAllowsMultipleSelection: NO];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanCreateDirectories:NO];
[openPanel setCanChooseFiles:YES];
[openPanel setAllowedFileTypes:fileTypes];
NSString * filePath = @"~/Desktop";
filePath = [filePath stringByExpandingTildeInPath];
NSURL *fileURL = [NSURL fileURLWithPath:filePath];
[openPanel setDirectoryURL:fileURL];
NSInteger clicked = [openPanel runModal];
if (clicked == NSFileHandlingPanelOKButton) {
for (NSURL *url in [openPanel URLs]) {
NSString *urlString = [url path];
[input setStringValue:urlString];
NSString *myString = [input stringValue];
NSString *oldPath = [myString lastPathComponent];
[inputDisplay setStringValue:oldPath];
}
}
teşekkürler - Hala bunu elde edemez. Ayrıştırma hataları alıyorum. – user1198008
Lütfen hangi hataları aldığınızı açıklayın. –
Üzgünüm. Sadece bir başka ihmal edildim * * sonra *]; Şimdi iyi çalışıyor. yardım için teşekkürler. – user1198008