[F-Script-talk] FSArchiver/FSUnarchiver bug?
Brought to you by:
pmougin
From: bill f. <fa...@pa...> - 2002-05-25 21:21:21
|
Trying to archive the converter from "Scripting Cocoa with F-Script" I encountered the following: > FSArchiver archiveRootObject: converter toFile: '/tmp/converter.fsobj' true > cvt := FSUnarchiver unarchiveObjectWithFile: '/tmp/converter.fsobj' > cvt value: 'moo' Uncaught system exception: signal 10 This may have something to do with message patterns, as avoiding them seems to avoid the problem. Paste the following into F-Script.app to reproduce: converter := [:title | |window conversionScript form button line| window := NSWindow alloc initWithContentRect:(125<>513 extent:400<>200) styleMask:NSTitledWindowMask + NSClosableWindowMask + NSMiniaturizableWindowMask + NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO. conversionScript := [(form cellAtIndex:2) setStringValue:(form cellAtIndex:0) floatValue * (form cellAtIndex:1) floatValue. form selectTextAtIndex:0]. form := (NSForm alloc initWithFrame:(60<>90 extent:320<>85)) autorelease. form addEntry:@{'Exchange Rate per $1', 'Dollars to Convert', 'Amount in Other Currency'}. form setAutosizesCells:YES; setTarget:conversionScript; setAction:#value. button := (NSButton alloc initWithFrame:(250<>20 extent:90<>30)) autorelease. button setBezelStyle:NSRoundedBezelStyle; setTitle:'Convert'; setTarget:conversionScript; setAction:#value. line := (NSBox alloc initWithFrame:(15<>70 extent:370<>2)) autorelease. window contentView addSubview:@{form, button, line}. window setTitle:title; orderFront:nil. ]. FSArchiver archiveRootObject: converter toFile: '/tmp/converter.fsobj'. cvt := FSUnarchiver unarchiveObjectWithFile: '/tmp/converter.fsobj'. cvt value: 'moo'. -- bill |