• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
can't save document in Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

can't save document in Tiger


  • Subject: can't save document in Tiger
  • From: Donald Hall <email@hidden>
  • Date: Sat, 14 May 2005 23:47:09 -0600

Title: can't save document in Tiger
My application works fine in Panther, and seems to work in Tiger except that I cannot save my documents.

I isolated the problem here in my NSDocument subclass:

- (IBAction)saveDocument:(id)sender
{
    NSLog(@"saveDocument entered");
    [self saveDocumentWithDelegate:self didSaveSelector:@selector(document:didSave:contextInfo:) contextInfo:sender];   
}

I set a breakpoint on the "saveDocumentWithDelegate" line, but this is not of much help, because when I try to step into the method, I immediately get the following output in my debugger console:

------------------------------------------------------------------------------
tty /dev/ttyp1
Program loaded.
(gdb) run
[Switching to process 1643 local thread 0xf03]
RunningŠ
2005-05-14 21:48:47.948 Script Timer[1643] saveDocument entered
Current language:  auto; currently objective-c
Program received signal:  "EXC_BAD_ACCESS".

Unable to disassemble objc_msgSend_rtp.
-----------------------------------------------------------------------

My didSaveSelector does have the correct signature (line below is copied from program):

- (void)document:(NSDocument *)doc didSave:(BOOL)didSave contextInfo:(void *)contextInfo
but it is never entered in any case.

The same thing happens when I try to do a "Save As" as well. The sheet comes up, but when I hit OK, I get the same message as above in the debugger console. Here is my "Save As" action method:

- (IBAction)saveDocumentAs:(id)sender
{
[self runModalSavePanelForSaveOperation:NSSaveAsOperation delegate:self didSaveSelector:@selector(document:didSave:contextInfo:) contextInfo:sender];
}

Here is what appears in the program's crash log:

-----------------------------------------------------------------------
Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000020

Thread 0 Crashed:
0   <<00000000>>  0xfffeff18 objc_msgSend_rtp + 24
1   com.apple.AppKit                    0x939562e0 -[NSDocumentController(NSInternal) _fixedFailureReasonFromError:] + 40
2   com.apple.AppKit                   0x9394fd34 -[NSDocument _willPresentSavingError:forOperation:url:] + 84
3   com.apple.AppKit             0x9394ffa8 -[NSDocument _saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] + 128
4   com.apple.AppKit                    0x938626b8 -[NSDocument saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] + 620
5   com.apple.AppKit              0x93862438 -[NSDocument saveDocumentWithDelegate:didSaveSelector:contextInfo:] + 296
6   com.appsandmore.Script Timer    0x0001b548 -[MyDocument saveDocument:] + 88 (MyDocument.m:1092)
-----------------------------------------------------------------------

I also just noticed that I cannot save the Unicode text file that my program uses for logging messages. In this case I use no custom code - just the Save menu item with the text file in the foreground:
-----------------------------------------------------------------------

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000020

Thread 0 Crashed:
0   <<00000000>>  0xfffeff18 objc_msgSend_rtp + 24
1   com.apple.AppKit                    0x939562e0 -[NSDocumentController(NSInternal) _fixedFailureReasonFromError:] + 40
2   com.apple.AppKit                   0x9394fd34 -[NSDocument _willPresentSavingError:forOperation:url:] + 84
3   com.apple.AppKit             0x9394ffa8 -[NSDocument _saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] + 128
4   com.apple.AppKit             0x938626b8 -[NSDocument saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:] + 620
5   com.apple.AppKit              0x93862438 -[NSDocument saveDocumentWithDelegate:didSaveSelector:contextInfo:] + 296
6   com.apple.AppKit                0x936bd274 -[NSApplication sendAction:to:from:] + 108
7   com.apple.AppKit               0x93717a70 -[NSMenu performActionForItemAtIndex:] + 392
-----------------------------------------------------------------------

Building specifically for Tiger with cleaned target seems to make no difference. (The project started in Jaguar and I simply reopened it in XCode 2.0 on Tiger.)

Can anyone help? It's not as though I am using a non standard way to save my documents -  surely this is a common way to save a document! Where do I go from here?

Thanks in advance,

Don


--
Donald S. Hall, Ph.D.
Apps & More Software Design, Inc.
email@hidden
http://www.appsandmore.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: launch safari to open an url
  • Next by Date: Re: NSTextView wants to wrap too soon
  • Previous by thread: Re: Ordered Sets and NSManagedObjectID
  • Next by thread: Open Dialogs and Save Dialogs
  • Index(es):
    • Date
    • Thread