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
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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
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
Hi,
in other words: When is time for versioning ?
After saving Xcode or saving or build the project ?
Or is there a time frame ?😊
Uwe
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
Hi,
in my first project (learning) i created a class and it works fine.
In the second I set an error, i should code "override class", although there is no parent class.
Please, make me stop crying.
Uwe
Hi, with my new iMac I want to continue learning swift,
I was told that the playground is a good tool and I trust.
I got the Xcode/New/Playground file and wrote some code - see it :
```import Cocoa
var greeting = "Hello, playground"
for i in 1...10{
print (i)
}
The same code runs on Xcode 9.2 (9C40b)
I can't help myself 🥲
Uwe
Edit:
I downloaded Michael Kofler's Swift 5 examples and they even did not run
Hello,
here is the block where arrayController is nil :
{
NSData * data;
NSError * error;
Class klass;
if(_arrayController != nil) // nil !
{
selected = [_arrayController selectedObjects];
arranged = [_arrayController arrangedObjects];
if([selected count] > 0)
{
_currentObject = [selected objectAtIndex:0];
if(_currentObject != nil)
{
data = [_currentObject valueForKey:kVrRoot];
klass = [NSMutableDictionary class];
_vrRoot =
[NSKeyedUnarchiver unarchivedObjectOfClass:klass fromData:data error:&error];
}else
{
_vrRoot = [NSMutableDictionary new];
data = [NSKeyedArchiver archivedDataWithRootObject:_vrRoot requiringSecureCoding:YES error:&error];
}
}
}
}
I use this for years so I don't no what's wrong.
Guten Tag,
my project is simple, first I want draw wired Hexa,-Tetra- and Octahedrons.
I draw a cube with Metal but I didn't found rotation, translation and scale.
I have searched help , the examples I found are too complicated for me.
Mit freundlichen Grüßen
VanceRegnet
This is not an error or warning, it appears in the console as a configuration error.
it's behind my horizon, maybe someone can tell.
Uwe
Hi,
I have no idea what happened, I got no warnings, no error.
When I used the Sandbox I got a GL_INVALID_VALUE error.
Please have I look at the attachments for illustration.
Hi,
I have different displayLists (dL) to create,
8 lists have a own name, the work fine.
Then I have a dynamic structure of dLs, they are stored in c-arrays.
After i noticed that they are not shown, I made 2 dLs which differ in color and vertices.
drawRect:
glCallLists(2,GL_UNSIGNED_INT, test);
This is my list-array:
if(contentState[0] == 1)
{
glCallLists(contentCount,GL_FLOAT, curveList);
}
contentCount = 8 and the declaration is GLfloat curveList[20]
curveList has 8 display indices.
I hope I made a mistake and you find it :)
Uwe
Hello,
I'm working on a small project to draw Lyapunov-Diagrams.
For this matter I need to show 3 images.
To show that the code is not totally wrong, I attached a NSLog, witch shows text I do not understand.
I hope you can help me.
Mit freundlichen Grüßen
Uwe
NSLog
Hi , I got this quote with 5800 repetitions (5.8 MB / 1k) :
`2023-05-25 01:02:59.021733+0200 LookAt[6404:302136] [general] *** -[NSKeyedUnarchiver validateAllowedClass:forKey:] allowed unarchiving safe plist type ''NSNumber' (0x7ff84cfe02f8) [/System/Library/Frameworks/Foundation.framework]' for key 'NS.objects', even though it was not explicitly included in the client allowed classes set: '{(
"'NSMutableDictionary' (0x7ff84cfb6b48) [/System/Library/Frameworks/CoreFoundation.framework]",
"'NSArray' (0x7ff84cfb68a0) [/System/Library/Frameworks/CoreFoundation.framework]"
)}'. This will be disallowed in the future
`
-(IBAction)readFile:(id)sender
{
NSData * data;
NSError * error = nil;
data = [_vrReadWrite readData:kFileComponentA];
NSSet * set = [_vrReadWrite setOfClasses];
_vrRoot = [NSKeyedUnarchiver unarchivedObjectOfClasses:set
fromData:data error:&error];
}```
I got the expected result, that's fine, but I'm not interested in this future.
Uwe
Hello, Metal is a hard biscuit.
the first part of my project is to draw wired platonic solids, I replaced the triangle with a cube which I want to rotate with two sliders.
But I don't no how, the MTKView is the view of the viewController, the sliders will rotate too, or not ?
Would you developers use the XIP ?