Can not save my Raisman data


#1

Hi,

I am using Xcode 4.4 and I’m stuck on Chapter 10 because I can not save data created with Raisman. I can edit , undo and redo the data but when I go to save the data I get the following error:

Any help would be much appreciated.

2012-08-02 13:15:42.918 RaiseMan[21154:303] dataOfType:error: is a subclass responsibility but has not been overridden.
2012-08-02 13:15:42.923 RaiseMan[21154:303] (
0 CoreFoundation 0x00007fff92b7c716 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff976f7470 objc_exception_throw + 43
2 CoreFoundation 0x00007fff92b7c4ec +[NSException raise:format:] + 204
3 AppKit 0x00007fff8f85b32c -[NSDocument dataOfType:error:] + 229
4 AppKit 0x00007fff8f41b017 -[NSDocument writeToURL:ofType:error:] + 772
5 AppKit 0x00007fff8f41acc2 -[NSDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] + 453
6 AppKit 0x00007fff8f41a5a3 -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:forceTemporaryDirectory:error:] + 547
7 AppKit 0x00007fff8f41a374 -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:error:] + 28
8 AppKit 0x00007fff8f419ef9 -[NSDocument writeSafelyToURL:ofType:forSaveOperation:error:] + 348
9 AppKit 0x00007fff8f419d87 __block_global_84 + 76
10 AppKit 0x00007fff8f41992f __block_global_91 + 242
11 AppKit 0x00007fff8f4195ae __block_global_90 + 339
12 AppKit 0x00007fff8f418f40 __block_global_83 + 1533
13 Foundation 0x00007fff93324e1e -[NSFileCoordinator(NSPrivate) _invokeAccessor:orDont:thenRelinquishAccessClaimForID:] + 229
14 Foundation 0x00007fff93307dca -[NSFileCoordinator(NSPrivate) _coordinateWritingItemAtURL:options:error:byAccessor:] + 705
15 AppKit 0x00007fff8f4188c3 -[NSDocument _fileCoordinator:coordinateReadingContentsAndWritingItemAtURL:byAccessor:] + 362
16 AppKit 0x00007fff8f418650 __66-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_0 + 920
17 AppKit 0x00007fff8f412b09 -[NSDocument continueFileAccessUsingBlock:] + 222
18 AppKit 0x00007fff8f417a64 __block_global_18 + 125
19 AppKit 0x00007fff8f88b0e2 __block_global_44 + 175
20 CoreFoundation 0x00007fff92b39982 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 18
21 CoreFoundation 0x00007fff92afa18f __CFRunLoopDoBlocks + 255
22 CoreFoundation 0x00007fff92b1e4d4 __CFRunLoopRun + 772
23 CoreFoundation 0x00007fff92b1ddd2 CFRunLoopRunSpecific + 290
24 HIToolbox 0x00007fff95839774 RunCurrentEventLoopInMode + 209
25 HIToolbox 0x00007fff95839454 ReceiveNextEventCommon + 166
26 HIToolbox 0x00007fff958393a3 BlockUntilNextEventMatchingListInMode + 62
27 AppKit 0x00007fff8f543fa3 _DPSNextEvent + 685
28 AppKit 0x00007fff8f543862 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
29 AppKit 0x00007fff8f53ac03 -[NSApplication run] + 517
30 AppKit 0x00007fff8f4df656 NSApplicationMain + 869
31 RaiseMan 0x0000000100001952 main + 34
32 RaiseMan 0x0000000100001924 start + 52
)


#2

method: [color=#FF0000]dataOfType:error:[/color]
Make sure that you correctly type in the name of this method and implement it exactly as described in the book.

Follow the instructions in Chapter 10, Page 16, Second Paragraph:
To add saving capabilities to …


#3

That was it!

I was missing "error:(NSError **)outError " , no idea of how that happened, thanks!

  • (NSData *)dataOfType:(NSString *)aType
    error:(NSError **)outError