i making variable declarations in nsviewcontroller custom class. declarations are:
var filtersettings: dictionary<string, string> = ["location": "all", "status": "all", "pprdate": "all", "project manager": "all"] let locationfiltersettings: set = ["all", "newcastle", "sydney", "act & southern nsw", "western sydney", "grafton"] let statusfiltersettings: set = ["all", "active", "inactive"] var pprdatefiltersettings: set<nsdate> = [] // value needs set programiticaly loading available ppr dates --- use pprdatefiltersettings.insert(datevariable) var projectmanagerfiltersettings: set<string> = [] // value needs set programatically loading available pms when program compiles 1 error shows in issues navigator: - compiler error not shown against particular line in code.
when go issue navigator shows against class following error. other classes compile correctly no errors:
"swift compiler error command failed due signal: segmentation fault: 11"
i admit not knowing how debug error.
i know if comment out let locationfiltersettings.. line in code compiler error goes away.
i have added code variables shown above , make other reference filtersettings valuable yet. no other changes have been made code compiling , running expected.
any advice on where/how debug issue please let me know. not sure next.
i should add running latest version of xcode , osx.
i have tried playing optional declaration suggested in 1 of answers here:-->swift compiler segmentation fault when building no avail.
edit: additional information.
- i deleted , re-installed xcode. error still occurred.
- having declared variables within class wasn't referencing them within functions tried println variables @ few spots in code. error still occurred.
- i moved declarations global level within class within 1 of functions. error disappeared.
so- 3 above partially solved issue me. wanted variables available through class may need pass them around parameters (which seems work). however, still not understand why error occurring , if syntax thing missing.
ok - have been able compile code without error properties declared @ top of class.
the issue use of short form declaration relying on type of item being inferred.
let propertyname: set = ["item1", "item2"] when initialised property using following syntax
let propertyname: set<string> = ["item1", "item2"] it compiled without error. short form declaration worked when property declared within function.
Comments
Post a Comment