Post

Replies

Boosts

Views

Activity

memory leak upon mouse down in a NSTextField
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
0
0
50
May ’25
Failure to unarchive a sprite kit particle file
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....
2
0
1.8k
Sep ’19