FROM : Jens Alfke
DATE : Thu Apr 24 21:20:19 2008
On 23 Apr '08, at 8:42 AM, an0 wrote:
> Nothing appeared when I opened a saved file, and log said:
> 2008-04-23 23:33:44.127 EasyDraw[631:10b] *** -[NSDocumentController
> localizedFailureReason]: unrecognized selector sent to instance
> 0x11b210
Something sent -localizedFailureReason: to an instance of
NSDocumentController, apparently thinking it was an NSError*.
Given this method:
> - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
> {
> return [NSKeyedArchiver archivedDataWithRootObject:view.drawing];
> }
I suspect what happened is that NSKeyedArchiver returned nil for some
reason, and the caller of that method then looked at *outError to find
the reason for the error; but you didn't store anything in there, so
it got whatever happened to be in that variable, which in this case
may have been a pointer to the NSDocumentController.
So try adding a test for nil to your save method. It looks like that's
where the problem is.
—Jens
DATE : Thu Apr 24 21:20:19 2008
On 23 Apr '08, at 8:42 AM, an0 wrote:
> Nothing appeared when I opened a saved file, and log said:
> 2008-04-23 23:33:44.127 EasyDraw[631:10b] *** -[NSDocumentController
> localizedFailureReason]: unrecognized selector sent to instance
> 0x11b210
Something sent -localizedFailureReason: to an instance of
NSDocumentController, apparently thinking it was an NSError*.
Given this method:
> - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
> {
> return [NSKeyedArchiver archivedDataWithRootObject:view.drawing];
> }
I suspect what happened is that NSKeyedArchiver returned nil for some
reason, and the caller of that method then looked at *outError to find
the reason for the error; but you didn't store anything in there, so
it got whatever happened to be in that variable, which in this case
may have been a pointer to the NSDocumentController.
So try adding a test for nil to your save method. It looks like that's
where the problem is.
—Jens
| Related mails | Author | Date |
|---|---|---|
| an0 | Apr 23, 17:42 | |
| Jens Alfke | Apr 24, 21:20 | |
| an0 | Apr 25, 10:11 | |
| Kyle Sluder | Apr 25, 10:29 | |
| an0 | Apr 25, 11:10 | |
| Kyle Sluder | Apr 28, 08:24 | |
| Michael Ash | Apr 28, 17:03 | |
| Michael Ash | Apr 28, 17:45 | |
| Kyle Sluder | Apr 28, 17:46 | |
| Kyle Sluder | Apr 28, 17:56 | |
| Kyle Sluder | Apr 28, 18:01 | |
| I. Savant | Apr 28, 18:34 | |
| Jens Alfke | Apr 29, 02:03 | |
| an0 | Apr 29, 17:15 |






Cocoa mail archive

