I am currently working on a web browser project from Apple’s Mac Dev site.
I have completed the project, but have a bit of a problem. I have created the project as a Document-Based Cocoa Application, and now whenever I enter text in any text field on the web, the red traffic light button shows a black dot in the middle that signifies an unsaved document. When I try to close the window or entirely quit the application, a warning pops up like that in TextEdit or Pages where it alerts me to unsaved changes. It’s not too much of a problem, but I would like if someone could please tell me how to remove that feature of a Cocoa Document-Based Application.
Why a document based application if your application isn’t document based? Document based applications inherently include the concept of
openandsave; it is a fundamental part of what they are.In any case, you could “work around” this by configuring
NSDocumentappropriately; override the proper methods and otherwise muck with the change count & dirty state of the document. But it’ll be just that, a workaround. The documentation forNSDocumenthas all the information you need.A cleaner overall solution would be to refactor your app to not use
NSDocument. Creating multiple windows is quite straightforward in Cocoa (an action method tied to a menu item where the action method loads a nib file; if I remember correctly, you could even useNSWindowControllerstill).