Posts

Post not yet marked as solved
5 Replies
The test is just a print from the addCheckValue func sender.state.If the button state is set "NSControl.StateValue.on" the return state is 1:0 as normal but "NSControl.StateValue.off" is still 1:0 so off is now 1 and on is 0.
Post not yet marked as solved
5 Replies
"file.add" is only a bool. The state in addCheckValue()) is where the problem is noticed, there's really nothing else to show, just for some reason setting the button state with NSControl.StateValue on or off reverses the value.if let cell = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "identCellAdd"), owner: nil) as? NSTableCellView { if let button = (cell.subviews[0] as? NSButton)Curious, is this the right way to work with the button ?
Post not yet marked as solved
10 Replies
Post not yet marked as solved
10 Replies
Post not yet marked as solved
10 Replies
If it's as bad as you say why does it exist ?
Post not yet marked as solved
10 Replies
I always use ...DispatchQueue.global(qos:?).async {...}Tried both ...DispatchQueue.main.async {...} DispatchQueue.main.sync {...}
Post not yet marked as solved
10 Replies
WindowController.close()Works fine but nothing within a Queue.
Post marked as solved
9 Replies
Yes the delegate works fine thank u.There is another problem but will make another post.
Post marked as solved
9 Replies
I think it's because it's on a different thread. I'll try to explain ...The main class has an instance of an instantiated WindowController which has the variable which will change, and WC's can only be created in the main thread. The second instance is within a "DispatchQueue.global(qos: .utility).async {...}" which is where I linked the variables.If I don't use a DispatchQueue I can't access the button which will change the var. I just see the waiting cursor icon.
Post marked as solved
9 Replies
Ok thanks.
Post marked as solved
9 Replies
Sorry not inheriting the class. So parent has 2 different classes both with same variable but one has the controlling to affect the other.class A { let class1 = B() let class2 = C() init() { class1.isRunning = class2.isRunning } } class B { var isRunning: Bool = false } class C { var isRunning: Bool = false func change() { ... } }
Post not yet marked as solved
6 Replies
If I choose "COPYFILE_ALL | COPYFILE_RECURSIVE | COPYFILE_MOVE" it won't work when the destination is a root folder.
Post not yet marked as solved
6 Replies
Just had another test and "flags |= COPYFILE_..." does work but for some reason COPYFILE_MOVE is causing a problem.
Post marked as solved
6 Replies
I tried in the callback "if isCancelled { return COPYQUIT }" which seems to work ok, however shows an error "error processing data: Invalid argument", but does carry on. Should I ignore this ? It's not the error thrown as specified, only happens when interrupting the flow.
Post marked as solved
6 Replies
Found an example of copyfile ... https://github.com/rustle/RSTLCopyOperation/blob/master/Copy/RSTLCopyOperation.mWithin the callback which I set up ok, having trouble specifically within the NSLog is %@ and %s no idea how it gets the total ?case COPYFILE_COPY_DATA: switch (stage) { case COPYFILE_PROGRESS: { off_t copiedBytes; const int returnCode = copyfile_state_get(state, COPYFILE_STATE_COPIED, &copiedBytes); if (returnCode == 0) { NSLog(@"Copied %@ of %s so far", [NSByteCountFormatter stringFromByteCount:copiedBytes countStyle:NSByteCountFormatterCountStyleFile], fromPath); }