Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!rochester!pt.cs.cmu.edu!wb1.cs.cmu.edu!avie From: avie@wb1.cs.cmu.edu (Avadis Tevanian) Newsgroups: comp.sys.next Subject: Re: Defaults Message-ID: <4740@pt.cs.cmu.edu> Date: 16 Apr 89 18:04:15 GMT References: <10013@orstcs.CS.ORST.EDU> Organization: NeXT, Inc. Lines: 35 In article <10013@orstcs.CS.ORST.EDU> jasmerb@mist.CS.ORST.EDU (Bryce Jasmer) writes: >I am trying to make use of the "defaults database" within a program that >I am writing and am having a little bit of trouble with it. I am getting >a segmentation violation when I make a call to "NXRegisterDefaults". >+initialize >{ > static NXDefaultsVector myDefaults = { > {"Misc", "1234"} > }; > > NXRegisterDefaults("MyApp", myDefaults); > return self; >} You need to NULL terminate the list of defaults. Try: static NXDefaultsVector myDefaults = { {"Misc", "1234"}, { NULL, NULL} }; I will tell our documentation people to make this clear in the TechDoc (the example there in 0.8 documentation has the same problem). -- Avadis Tevanian, Jr. (Avie) Chief Operating System Scientist NeXT, Inc. avie@cs.cmu.edu or avie@NeXT.com -- Avadis Tevanian, Jr. (Avie) Chief Operating System Scientist NeXT, Inc. avie@cs.cmu.edu or avie@NeXT.com --