nsdocument

How to disable NSDocument's window title popup

↘锁芯ラ 提交于 2019-12-06 23:21:31
问题 I have an NSDocument based app with autosave enabled. I'd like to prevent this popup from showing: I have tried returning nil from NSWindow's –title, –representedFilename and –representedURL which hide the title effectively hide the title but have no effect on the downward facing disclosure indicator and the popup. Is there a way I can prevent this popup from being presented? 回答1: I was able to prevent the button from being shown by overriding NSWindow's + (NSButton *)standardWindowButton:

NSDocumentController currentDocument returning nil

独自空忆成欢 提交于 2019-12-06 21:06:39
问题 I'm working on my first Mac document-based application. I have subclassed NSDocument , reimplementing methods such as - (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError; - (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError; - (void)makeWindowControllers; The main window controller is a subclass of NSWindowsController , that contains two NSViewController subclasses. The problem I'm facing is that I need to

display all videos stored in document directory

☆樱花仙子☆ 提交于 2019-12-06 16:35:36
I stored videos in my document directory from photo library. Now i want to show all videos which are stored in my document directory.. but i don't know how its possible??? Actually i want to display all videos as like its open in photo library(four videos in a single row).. and when i click on any video... the video is start playing... can anybody help me which is the best way to show all videos from document directory to ViewController.... Thanx...... - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSURL * movieURL = [info

How can I set the title of non-main-windows in an NSDocument application?

核能气质少年 提交于 2019-12-06 11:50:09
I am working on a document-based OSX application, with master-detail style windows. I understand how to open additional windows, to display additional information, by using -makeWindowControllers and adding extra window controllers, but I can't set the title of the new windows. I have tried using -setTitle and -windowTitleForDocumentDisplayName in both Document.m and in my sub-classed window controller class, but I can't get the window title to change. How do I change the title of non-main-windows, which have a sub-classed window controller, in an NSDocument based application? EDIT: I know

Xcode document icon not updating

流过昼夜 提交于 2019-12-06 06:51:07
I've created an .icns and set it in the Document Types section of my project, but my documents' icons in Finder remain generic. I've noticed that if I change my document type's file extension, the icon displays. Is there a cache I need to clear or some other way to update the icon without changing the file extension? To force refresh icon put this into your terminal /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user; killall Dock Mavericks: /System/Library/Frameworks/CoreServices

How do I initialise a new NSDocument instance in Swift?

岁酱吖の 提交于 2019-12-05 23:05:02
问题 Apple documentation suggests to override an NSDocument convenience init (initWithType:error:) as described here. However, as this is a convenience init, I cannot override it. But I still need to execute some code when a new document is created. I do not want to execute that code when I load a document. In my particular case I try to initialise an NSPersistentDocument, but I doubt that is relevant. What shall I do? 回答1: To execute init code for a new document: // Create new document (only

Cocoa NSDocument: getting autosave to work

烂漫一生 提交于 2019-12-05 10:30:17
Documentation simply states that setting setAutosavingDelay to anything > 0 on the shared doc controller should do it, but after calling [[NSDocumentController sharedDocumentController] setAutosavingDelay:2.0]; in my controller, autosave doesn't seem to work: I neither see anything in ~/Library/Autosave Information/ , nor is [[[NSDocumentController sharedDocumentController] currentDocument] autosavedContentsFileURL] initialized. Note that in my app, normal loading and saving work fine (keyedarchivers, nscoding-based class for my docs, etc). Have you overridden -updateChangeCount: at all? I'm

How does NSDocumentController slot into my document based app?

冷暖自知 提交于 2019-12-05 10:12:09
I'm building my first serious Cocoa app. It is a document based app using Core Data for persistent storage. Using the Xcode "New project" template options, my project started with a couple of default classes: MainMenu.xib (the main menu of my app) EventDocument.xib (the main window of my app) EventDocument.h and EventDocument.m (the persistent document class) I took the design from there and it all works rather nicely, however through another question I came across a Cocoa class NSDocumentController which I was not aware of. This class apparently offers default logic for managing document

Cocoa document based app, NSWindowController subclass as “main window”

烂漫一生 提交于 2019-12-05 04:30:15
问题 I have a Cocoa document based app. I want the "main window" to be managed by my subclass of NSWindowController . I have created the subclass and laid out its interface in a .xib file with the same name. I ultimately want the same behaviour as if the NSDocument managed the window, but instead have it managed by an NSWindowController . First of all, how do I do it? Second, are the anything special I have to think about when going with this approach, such as how to handle open and save? 回答1:

How to disable NSDocument's window title popup

谁说我不能喝 提交于 2019-12-05 03:40:44
I have an NSDocument based app with autosave enabled. I'd like to prevent this popup from showing: I have tried returning nil from NSWindow's –title, –representedFilename and –representedURL which hide the title effectively hide the title but have no effect on the downward facing disclosure indicator and the popup. Is there a way I can prevent this popup from being presented? I was able to prevent the button from being shown by overriding NSWindow's + (NSButton *)standardWindowButton:(NSWindowButton)windowButtonKind forStyleMask:(NSUInteger)windowStyle and returning nil for