Re: [F-Script-talk] FSArchiver/FSUnarchiver bug?
Brought to you by:
pmougin
From: bob a. <rd...@pa...> - 2002-05-26 00:00:34
|
On Saturday, May 25, 2002, at 02:21 PM, bill fancher wrote: > 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'}. note that the line above is where the error occurs. that's your clue. it works in FScript, but not on unarchiving. i would guess that it isn't archiving the item within? and storing off a value that isn't valid on unarchiving. but then again... it the inspector is showing me the actual text that it is failing on, not some pointer thingy. so, i don't know what. post the answer if you figure it out. i have only made half-way through the guide, so i am 1/2 past a total beginner. fun stuff. almost no activity on this list. although i did get responses when i posted questions. from Philippe. if you don't get an answer you could try emailing him directly. i got a response that way the first time i had a problem. actually, i note that you answered my first question on this list. hello, again. > 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 > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > F-Script-talk mailing list > F-S...@li... > https://lists.sourceforge.net/lists/listinfo/f-script-talk > |