Re: Failure on unarchiving a NSBezierPath

2008-04-29 Thread an0
On Tue, Apr 29, 2008 at 12:01 AM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > You know what? I don't think you've ever said that you know that > view.drawing != nil. Check that. > > --Kyle Sluder > Oh, what a shame for me to overlook such a critical check! Thank you for helping me find this fooli

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread Jens Alfke
On 28 Apr '08, at 8:56 AM, Kyle Sluder wrote: Not necessarily true in the general case. The semantics of buffered output may interfere, especially if instead of just sending unrecognized selectors to a random object the code were sending messages to a pointer off in la-la land. It's always a

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread I. Savant
> You know what? I don't think you've ever said that you know that > view.drawing != nil. Check that. Though NSArchiver says this scenario would produce an exception, NSKeyedArchiver does not seem to do the same (the documentation doesn't say what will happen and a quick test with an NSBezie

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread Kyle Sluder
On Wed, Apr 23, 2008 at 11:42 AM, an0 <[EMAIL PROTECTED]> wrote: > I was building a very simple drawing application, but met problems > when reading the file saved by my application. > > The two functions as to archiving/unarchiving are as follows: > - (NSData *)dataOfType:(NSString *)typeName erro

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread Kyle Sluder
On Mon, Apr 28, 2008 at 11:45 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > Nothing is being obstructed. The logged errors happen after the > primary problem occurs. If the primary problem were logging errors, > they would appear before the ones that are caused by the lack of an > error assignment.

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread Kyle Sluder
On Mon, Apr 28, 2008 at 11:03 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > I don't think you're getting the point yourself. The reason he's > returning NO is because his unarchiving fails, and it shouldn't fail. > Certainly the code *should* set the error (if outError is non-nil) but > this is a se

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread Michael Ash
On Mon, Apr 28, 2008 at 11:43 AM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Mon, Apr 28, 2008 at 11:03 AM, Michael Ash <[EMAIL PROTECTED]> wrote: > > I don't think you're getting the point yourself. The reason he's > > returning NO is because his unarchiving fails, and it shouldn't fail. > > C

Re: Failure on unarchiving a NSBezierPath

2008-04-28 Thread Michael Ash
On Mon, Apr 28, 2008 at 2:24 AM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Fri, Apr 25, 2008 at 5:10 AM, an0 <[EMAIL PROTECTED]> wrote: > > Thanks a lot if you or others can give me some more hint. > > You really aren't getting the point. > > You're returning NO from -readFromData:ofType:erro

Re: Failure on unarchiving a NSBezierPath

2008-04-27 Thread Kyle Sluder
On Fri, Apr 25, 2008 at 5:10 AM, an0 <[EMAIL PROTECTED]> wrote: > Thanks a lot if you or others can give me some more hint. You really aren't getting the point. You're returning NO from -readFromData:ofType:error. You're not setting *outError to anything meaningful. Therefore your program is p

Re: Failure on unarchiving a NSBezierPath

2008-04-25 Thread an0
Sorry for my careless, I though Jens was talking about the `read' part. However, as I said, the error occurred when reading not when writing. So it was not because > NSKeyedArchiver returned nil but because `[NSKeyedUnarchiver unarchiveObjectWithData:data]' returned nil, and my `readFromData:(NSDat

Re: Failure on unarchiving a NSBezierPath

2008-04-25 Thread Kyle Sluder
On Fri, Apr 25, 2008 at 4:11 AM, an0 <[EMAIL PROTECTED]> wrote: > Thanks. But it seems you haven't read to the end. As I said in my first mail: > > > Besides, I found the value returned by [NSKeyedUnarchiver > > unarchiveObjectWithData:data] was nil, but I didn't understand why, > > since it was

Re: Failure on unarchiving a NSBezierPath

2008-04-25 Thread an0
Thanks. But it seems you haven't read to the end. As I said in my first mail: > Besides, I found the value returned by [NSKeyedUnarchiver > unarchiveObjectWithData:data] was nil, but I didn't understand why, > since it was normal when I saved the file using [NSKeyedArchiver > archivedDataWithRootOb

Re: Failure on unarchiving a NSBezierPath

2008-04-24 Thread Jens Alfke
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

Failure on unarchiving a NSBezierPath

2008-04-23 Thread an0
I was building a very simple drawing application, but met problems when reading the file saved by my application. The two functions as to archiving/unarchiving are as follows: - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { return [NSKeyedArchiver archivedDataWithRootO