Hi all,I'm having trouble in trying to access the content of a sprite kit particle file in a way that conforms with the recent deprecation of several functions in NSKeyedArchiver.Briefly, my project contains a file named "ParticleSmoke.sks", which I used to access easily with the following lines of code: NSString *smokePath = [[NSBundle mainBundle] pathForResource:@"ParticleSmoke" ofType:@"sks"]; SKEmitterNode* smoke = [NSKeyedUnarchiver unarchiveObjectWithFile:smokePath];now that the unarchiving function has been deprecated, I fail to use the (poorly documented) unarchivedObjectOfClass function. Especially, the code below returns nil. NSString *smokePath = [[NSBundle mainBundle] pathForResource:@"ParticleSmoke" ofType:@"sks"]; NSData* smokeData = [NSData dataWithContentsOfFile:smokePath]; NSError* error=nil; Class cls = [SKEmitterNode class]; SKEmitterNode* smoke = (SKEmitterNode*)[NSKeyedUnarchiver unarchivedObjectOfClass:cls fromData:smokeData error:&error];Unexpectedly, the content of "error" (code 4864) was@"NSDebugDescription" : @"value for key 'NS.objects' was of unexpected class 'NSColor'. Allowed classes are '{(\n SKKeyframeSequence,\n NSArray,\n NSNumber,\n NSMutableArray\n)}'."Has anyone an idea to fix this issue?Thanks for your help....
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Dear all,
Sorry if the topic has already been commented but I could not be able to find it in over 10,000 picks using the forum search field...
My problem is that with any NSTextField in my app, a click will result in a memory leak. There is no code attached, just bindings to NSNumber properties. How can I fix this ?
Thanks for your help.
Best regards
Chris
Topic:
UI Frameworks
SubTopic:
AppKit
After having used Obj-C and C++ for years, I recently (~6 months) moved to Swift, which is hard for me but most often sends less obscure error messages (not always). My trouble is 1- why is it soooooo long (sometimes up to 20s - that's horrible) to get an object's variables accessible in the debugger? 2- In Xcode 16 why is it no longer possible to arrange my files as I did before (organised into folders from within Xcode - horrible when you get a bigger and bigger project)? 3- Why has it become impossible to see the retention cycles and retaining objects from with the memoryGraph (it's worth ~nothing) now !