Posts

Post not yet marked as solved
1 Replies
here is what caused that issue: when you save the file for the very first time, your identifier is exactly the way you type it in in the text field. here's mine: com.BkTools.blockingDoc when you save changes to a file, the identifier is lowercased: com.bktools.blockingdoc I actually test for my type identifier, because I will probably need to have more than one. So I uses a Switch. and the list of options needs to be exhaustive, so I have a Default: option that returns an empty Data() But that should never get called. under any circumstances. I have a closed loop here. I am saving MY file type, I Am opening MY file type. I have written down MY identifier, so I can Expect MY file identifier. except. I can't. Somebody transforms my identifier before I get it. which is a cardinal sin. WORSE, they transform my identifier, only SOME of the time. which in my book is far far worse a cardinal sin. the workaround... when I inevitably run into this problem again and there's no documentation then either: is to either use all lowercase in the identifier, or to use the convenience method : lowercase() on the string in the switch and just check for the lower case version. half a day looking for that little gem.
Post not yet marked as solved
1 Replies
that is the error message generated when it crashes. the AMD Radeon Pro W5700X 16 GB is apparently incapable of raytracing.
Post not yet marked as solved
2 Replies
the net result was: the book I was following made assumptions that turned out to be wrong. The code in the book could never work. the Matrix4x4 structure in the book assumes a row layout in the the float4x4 used in Metal. It doesn't work like that. it uses a Column layout. ie: the matrix I built from the tutorial assumed that each simd_float4 passed in was going to be a row. instead it was a column. this screwed up everything. but I also had issues with the matrix weirdly breaking my identity values. that screwed up everything. and my rotation function, was faulty.
Post not yet marked as solved
2 Replies
thanks Quinn, I "think" I was worried over nothing. As I recall, I was worried that In the plugin itself, I assumed that getting the "main" bundle I'd wind up with the Plugin's bundle. But, I tried it. and it seems to give me the Host Application's Bundle. Which is what I wanted, but did not expect.
Post marked as solved
3 Replies
var.if var envelope = theParent as? CNEnvelopment{
Post marked as solved
3 Replies
there is a parent class to the classes that are CNEnvelopment.so the child classes are something like :public class CNNode : CNDagObj, CNIdentity, CNProperties, CNEnvelopment, CNStackObj, CNDagConnection, BKObserver, CNRenderable, CNOutputsObj {CNDagObj is the parent class. Not all CNDagObjects are CNEnvelopment.the Property in which we find the CNEnvelopment, is of the class CNDag.public var parent : CNDagObj? = nilall objects that will be a parent, will also be CNEnvelopment, But as I recall... the compiler doesn't like it if I do this instead :public var parent : CNEnvelopment? = nilso I'm stuck with the next lowest common denominator class (CNDag) i suppose i should :if let envelope = theParent as? CNEnvelopment{?
Post not yet marked as solved
25 Replies
not for me. the app actually compiles and runs in the OS. This is a BUG in XCode.
Post marked as solved
2 Replies
Thanks OOPer,i knew it was going to be easier than what I was doing.youre a lifesaver.
Post not yet marked as solved
2 Replies
turns out: no. it doesn't work. not at all. SteamVR mac seems to have been abandonded in Beta, and it's the only option for VR on the mac. the headset seems to work just fine. aspects of SteamVR seem to work just fine... anything that presents content, is thoroughly buggy. and it's buggy in a way that makes me think it was sabotaged.
Post not yet marked as solved
3 Replies
Any word on this situation getting better?vive pro here with a 2019 mac Pro. the controllers firmware updated after numerous tries. Nothing else did.having really unacceptable problems with the head unit, but I cannot even perform the first step in troubleshooting: updating the firmware.
Post not yet marked as solved
4 Replies
I "think" i may have tried that at one point. my not-terribly-clear memory is that without a specifically typed return value, it becomes even more work. Once you set the return value to Any in the superClass, or the protocol, you have to use Any as the return value in the subclass. Otherwise any method that defines a different type is treated as an overloaded method, and not an overridden method. make sense? in other words, you get the ability to declare it in the superclass/protocol like I wanted, but you lose the benefit of being able to rely on the subclass for setting type. And that becomes a big headache on it's own.
Post not yet marked as solved
2 Replies
sorry, should have book-ended this with the rest of the story.Xcode, just didn't work. I followed the process to add a playground to my project, imported the framework into the project, imported it into my playground. and that errored out. no such framework as far as the playground was concerened. then I posted this in the forums. then I had a handful of other problems, with the same project.then I rebuilt my project, writing every line of code from scratch... no copying. just looking at it, and refactoring as I went. the same process produced different results. I now have a playground in my project that can import the frameworks in question.So it was just buggy behavior in XCode.
Post marked as solved
3 Replies
so defining my own struct... that's what I did (before I decided I needed a refernce type, and converted everything to objects) and it was fine.I can work with that. You've answered my question, and the answer is sort of. if I hadn't disembarked from Structs to Classes I's probably go ahead and duplicate what you've done. That would work for me, thanks!
Post not yet marked as solved
3 Replies
ultimately, I was not able to make other parts of the solution work. It was something I found online to save a Homogenous Array, without stripping object type from the various object instances. Basically, even the donloadable 'finished' code... didn't compile, and it's way beyond me to try to figure it out. Although I did make an attempt and I feel like I gained some mildly deeper understanding of encoders/decoders... I don't feel that I have come away with a comprehensive understanding. I looked for a Codable 201 type coursework, would have helped. while lamenting this failed solution, which had me doing things that I was very uncomfortable doing, I hit on the main problem: there's no good way to interperet the incoming elements of an array in order to determine what class they are (indeed, that goes against the security needs answered by Codable and NSSecureCoding.)and it occurred to me that a wrapper class would work better, require less "acrobatic plumbing" in features of the language that are alien to me, and be fairly straight forward to setup. And the main thing about the wrapper class... it would allow me an opportunity to examine each object and figure out which class it is.the wrapper class has 2 properties :1. a 'type' property. an enum of Strings... just a set of keys really, that indicate class.2. a property of the same type as the array in question (in this case CNProperty)when it comes time to encode the array, you simply map the array to an array of wrapper objects. the wrapper, when it's object is set, automatically sets the type. and you encode that.when you decode the Wrapper array, the wrapper loads the type first. then it does a switch on the type, and loads the wrapped object as the appropriate type.it's another simple map to set the array from the wrapped objects.it's not trivial work, and I am not exactly happy that developers are sandbagged by security features in this way, but the new solution is fairly portable, easy to understand, and works without monkeying around in the guts of the language. It's a far cry from the solution I found online, and I feel like again... the next level of swift understanding has eluded me. But I'm the only person I know doing this, I'm self trained, and the Swift.org website is a place where people use opaque language, and throw around indescipherable buzzwords. One day, swift will stop being the wild west, and there will actually be human readable documents explaining all of this. meanwhile : my Object based solution:this is the object that I wrote that saves the array:the array is called 'props' take a look at the lines that encode and decode it. nothing fancy. but it works.public class CNProps : CNDagObj { public var props: [CNProperty] = [] private enum CodingKeys: String, CodingKey { case props } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(props.map({CNPropertyWrapper(prop: $0)}) , forKey: .props) } required public init(from decoder: Decoder) throws { super.init() let container = try decoder.container(keyedBy: CodingKeys.self) let wrappers = try container.decode([CNPropertyWrapper].self, forKey: .props) props = wrappers.map({ $0.prop }) } public init(props: [CNProperty]) { self.props = props super.init() } public init(position: CGPoint, props: [CNProperty]) { self.props = props super.init(position: position) } }here's my wrapper class (i'm leaving out the various classes we are wrapping... it'l will just bog down the discussion CNProperty is the superClass, everything else is a subclass):the Choice to mirror the exact names of the classes in my enum, against the norms of lowercaing the first letter... That was made to help fight my dyslexia a bit. I might go back and change it, now that I know I've got the pattern worked out.public enum propType : String, Codable{ case CNProperty = "CNProperty" case CNFloatProp = "CNFloatProp" case CNStringProp = "CNStringProp" case CNBoolProp = "CNBoolProp" case CNIntProp = "CNIntProp" case CNClampedFloatProp = "CNClampedFloatProp" case CNColor_rgbaProp = "CNColor_rgbaProp" case CNPoint_xyProp = "CNPoint_xyProp" case CNSize_whProp = "CNSize_whProp" case CNSize_whdProp = "CNSize_whdProp" case CNVector_xyzProp = "CNVector_xyzProp" } class CNPropertyWrapper : Codable { var type : propType = .CNProperty var prop : CNProperty! = nil private enum CodingKeys: String, CodingKey { case prop case type } init(prop: CNProperty) { self.prop = prop self.setType() } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(type, forKey: .type) try container.encode(prop, forKey: .prop) } required public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) type = try container.decode(propType.self ,forKey: .type ) switch type{ case .CNProperty: prop = try container.decode(CNProperty.self ,forKey: .prop ) case .CNFloatProp: prop = try container.decode(CNFloatProp.self ,forKey: .prop ) case .CNStringProp: prop = try container.decode(CNStringProp.self ,forKey: .prop ) case .CNBoolProp: prop = try container.decode(CNBoolProp.self ,forKey: .prop ) case .CNIntProp: prop = try container.decode(CNIntProp.self ,forKey: .prop ) case .CNClampedFloatProp: prop = try container.decode(CNClampedFloatProp.self ,forKey: .prop ) case .CNColor_rgbaProp: prop = try container.decode(CNColor_rgbaProp.self ,forKey: .prop ) case .CNPoint_xyProp: prop = try container.decode(CNPoint_xyProp.self ,forKey: .prop ) case .CNSize_whProp: prop = try container.decode(CNSize_whProp.self ,forKey: .prop ) case .CNSize_whdProp: prop = try container.decode(CNSize_whdProp.self ,forKey: .prop ) case .CNVector_xyzProp: prop = try container.decode(CNVector_xyzProp.self ,forKey: .prop ) } } func setType(){ switch self.prop{ case is CNFloatProp: self.type = .CNFloatProp case is CNStringProp: self.type = .CNStringProp case is CNBoolProp: self.type = .CNBoolProp case is CNIntProp: self.type = .CNIntProp case is CNClampedFloatProp: self.type = .CNClampedFloatProp case is CNColor_rgbaProp: self.type = .CNColor_rgbaProp case is CNPoint_xyProp: if self.prop is CNVector_xyzProp{ self.type = .CNVector_xyzProp }else{ self.type = .CNPoint_xyProp } case is CNSize_whProp: if self.prop is CNSize_whdProp{ self.type = .CNSize_whdProp }else{ self.type = .CNSize_whProp } default: break } } }