• 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
Archive crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Archive crash


  • Subject: Archive crash
  • From: "Smith, Bradley" <email@hidden>
  • Date: Tue, 6 Aug 2002 15:35:05 +0100

Hi everyone,
Firstly apologies to any to whom I've accidentally sent a personal message
when it was meant to go to the list (only just noticed that reply went to
the poster - different from the Newton list!).

Now, I have a multi-doc Cocoa app. At the moment is just has an
NSMutableArray of NSBezierPaths. The problem I have is that when I load a
document I get one of those SIGNAL crashes and the app shuts. Here's a few
code snippets from the areas that I think (with my limited knowlege) may
have gone wrong: -

// My Document class

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
// strokes is a mutable array of pointers to a a class called
LayoutStroke
return [NSArchiver archivedDataWithRootObject: strokes];
}

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)docType
{
[strokes release];
strokes = [[NSUnarchiver unarchiveObjectWithData:data] retain];
[self refreshTheView];
return YES;
}

// My LayoutStroke class header and impl
// HEader
@interface LayoutStroke : NSObject<NSCoding>
{
NSBezierPath *theStroke;
}
- (id)initWithStart:(NSPoint) point;
- (void)draw;
- (void)addWayPoint:(NSPoint) point;

// Impl
- (id)initWithCoder:(NSCoder *)coder
{
if (self = [super init])
{
theStroke = [coder decodeObject];
}
return self;
}

- (void)encodeWithCoder:(NSCoder *)coder
{
[coder encodeObject: theStroke];
}

Now, I'll be amazed if anyone spots the problem just from this but maybe
there's some basic concept that I've got wrong?

best regards (fingers crossed!)
Brad
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Replacing Font/Size of NSMutableAttributedString, but not styles
  • Next by Date: Re: Accessor methods and (auto)release: conclusion
  • Previous by thread: Re: How to know if Internet connection is active?
  • Next by thread: Re: Archive crash
  • Index(es):
    • Date
    • Thread