Post

Replies

Boosts

Views

Activity

viewDidLoad: _view.device = MTLCreateSystemDefaultDevice(); crashes
Hi, obj-c (void)viewDidLoad {     [super viewDidLoad];     _view = (MTKView *)self.view;     _view.device = MTLCreateSystemDefaultDevice(); // - Error . . . } with Xcode 9.3 it runs normal with 12.4 I get the note:  Failed to set (contentViewController) user defined inspected property on (NSWindow): -[NSView setDevice:]: unrecognized selector sent to... Mit freundlichen Grüßen Uwe
3
0
1.1k
Mar ’21
Cannot set a debug point, project breaks in assembler code.
Hi altogether, I'm not a professional developer, I work k on projects for me and my children. If I do not set a breakpoint the project behaves normal. This issue appears in all projects, even in examples that I downloaded ("Metal by Tutorials", "Hacking with macOS"). It appears anywhere, whatever method I choose. I created a new project and got the warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.16, but the range of supported deployment target versions is 10.6 to 10.15.99. The project breaked. After I set the target to 10.15 it breaked too: obj-C DebugTest`-[AppDelegate applicationDidFinishLaunching:]:     0x1000029e0 +0:   pushq  %rbp     0x1000029e1 +1:   movq   %rsp, %rbp     0x1000029e4 +4:   subq   $0x20, %rsp     0x1000029e8 +8:   movq   %rdi, -0x8(%rbp)     0x1000029ec +12:  movq   %rsi, -0x10(%rbp)     0x1000029f0 +16:  movq   $0x0, -0x18(%rbp)     0x1000029f8 +24:  leaq   -0x18(%rbp), %rax     0x1000029fc +28:  movq   %rax, %rdi     0x1000029ff +31:  movq   %rdx, %rsi     0x100002a02 +34:  callq  0x100008c3a               ; symbol stub for: objc_storeStrong   0x100002a07 +39:  movq   0xbcf2(%rip), %rax        ; (void *)0x000000010000eaa8: AppDelegate Please help, I cannot code without debugging. Uwe  
5
0
1.3k
Feb ’21
NSKeyedUnarchiver decodeObjectOfClasses failed
I tried to read an Object : -(NSMutableDictionary*) readMyObject:(NSData*)data; { NSError * error; Class class = [NSMutableDictionary class]; NSMutableDictionary * dict; dict = [NSKeyedUnarchiver unarchivedObjectOfClass:class fromData:data error:&error]; return dict; the result was nil. I searched by Developer for a solution and found one : { // NSKeyedUnarchiver * unarchiver = [[NSKeyedUnarchiver alloc] init]; [unarchiver decodeObjectOfClasses: [[NSSet alloc]initWithArray: @[[NSDictionary class], [NSMutableDictionary class], [NSArray class], [NSMutableArray class], [NSString class], [NSNumber class]]] forKey:NSKeyedArchiveRootObjectKey]; [unarchiver finishDecoding]; } The first line was from me and it crashed the project. I assume there is an easy answer, not for me.🥲 Uwe
6
0
2k
May ’24
how to implement a tableview.notification in Swift
Hi, I used this notification in objective-c with success : { NSNotificationCenter * center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(rowSelectionDidChange:) name:NSTableViewSelectionDidChangeNotification object:nil]; // ... } With Swift I got 5 errors: selector: #selector: ( NSTableView.rowSelectionDidChange(_:)), name:"NSTableViewSelectionDidChangeNotification", object: nil) I hope you can teach me. Uwe
8
0
1.8k
Mar ’23