Posts

Post not yet marked as solved
2 Replies
444 Views
I have the legacy app that maintain its own thread pool to do cpu intensive work. It uses NSProcessInfo.processInfo.activeProcessorCount to get number cores and max thread pool size. It worked quite fine for Intel-based Macs but for Apple Silicon Macs it does not make much sense to create more threads than there are high-performance cores. How do I get the number of high-performance cores on Apple Silicon Macs?
Posted
by vokbuz.
Last updated
.
Post marked as solved
5 Replies
1.7k Views
How to get rid of this warning? NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. I do not set minSize or maxSize, it is Interface Builder that seems to do this. Even if I create completely new interface from scratch, this warning still appears. What is the point of introducing this warning if Apple tools unable to produce correct behaviour?
Posted
by vokbuz.
Last updated
.
Post not yet marked as solved
0 Replies
348 Views
Is there a public API that lets you query information on currently playing media and issue commands like skip forward for 15 seconds? There is a MediaPlayer framework but it seems to only have an API for players, which are on the other end of communication.
Posted
by vokbuz.
Last updated
.
Post marked as solved
1 Replies
603 Views
There is a LoginItem in my app that launches the application. It works fine with approximately the following code snippet:     NSBundle* bundle = NSBundle.mainBundle;     NSWorkspace* workspace = NSWorkspace.sharedWorkspace;     NSString* path = bundle.bundlePath;     for (int i = 0; i < 4; ++i) {       path = [path stringByDeletingLastPathComponent];     }     NSDictionary* configuration = @{ NSWorkspaceLaunchConfigurationEnvironment: env };     NSError* error = nil;     [workspace launchApplicationAtURL: [NSURL fileURLWithPath: path] options: NSWorkspaceLaunchDefault configuration: configuration error: &error];     if (error) {       NSLog(@"Failed to run the app: %@", error.localizedDescription);     } Since 11.0, launchApplicationAtURL: is deprecated in favour of openApplicationAtURL:. When I try to use it instead, the application does not start at all and no error is reported. What am I doing wrong? The new code looks like this:     NSWorkspaceOpenConfiguration* configuration = [NSWorkspaceOpenConfiguration configuration];     [configuration setEnvironment: env];     [configuration setPromptsUserIfNeeded: YES];     [workspace openApplicationAtURL: [NSURL fileURLWithPath: path] configuration: configuration completionHandler:^(NSRunningApplication* app, NSError* error) {       if (error) {         NSLog(@"Failed to run the app: %@", error.localizedDescription);       }     }];
Posted
by vokbuz.
Last updated
.
Post not yet marked as solved
2 Replies
373 Views
Is there a standard UI resizing protocol for Audio Unit? I want my plugin's UI to be resizable by the user but can't figure out how to do this natively. All searches lead to the resizing by audio unit's intent not user's. I know I can emulate resizing by capturing mouse events and resizing the view as a reaction to them, but what about native support? I noticed that if I move cursor to AudioUnit's UI window edges in Logic and GarageBand, cursor changes to the one of resizable window, so it seems that there should be a way. Thanks in advance.
Posted
by vokbuz.
Last updated
.
Post not yet marked as solved
0 Replies
263 Views
Hi. If I add this property to Info.plist in my project &lt;key&gt;version&lt;/key&gt; &lt;integer&gt;$(AU_VERSION)&lt;/integer&gt; this Info.plist is not editable anymore, also the project cannot be built. AU_VERSION is a user-defined setting which is an integer. If I replace it with string type, Info.plist becomes loadable and project compiles fine. &lt;key&gt;version&lt;/key&gt; &lt;string&gt;$(AU_VERSION)&lt;/string&gt; But I need this property to be integer. This is an AudioUnit and it does not work if this property is a string. Is this a known problem? How do I solve this? And why in the world validation happen before substitution? This behaviour does not look logical to me.
Posted
by vokbuz.
Last updated
.
Post not yet marked as solved
0 Replies
528 Views
I have a layer backed view with sublayers. It is a part of a larger view. This lager view is removed and added back to some view hierarchy.When I remove this larger view from its superview, the layer backed view loses the backing layer and therefore all sublayers. So when I add all this back, it doesn't look like it should (layers are missing).I found that -[NSView setLayer: nil] is called by AppKit from -[NSView removeFromSuperview]: * frame #0: 0x00000001228b4ba4 ***`***::setLayer(self=0x0000000104aa1830, cmd="setLayer:", layer=0x0000000000000000) at **** frame #1: 0x00007fff84506244 AppKit`-[NSView _setWindow:] + 755 frame #2: 0x00007fff86a31a52 CoreFoundation`__53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114 frame #3: 0x00007fff86a318e6 CoreFoundation`-[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 198 frame #4: 0x00007fff84da12a7 AppKit`__21-[NSView _setWindow:]_block_invoke.643 + 151 frame #5: 0x00007fff84506ae6 AppKit`-[NSView _setWindow:] + 2965 frame #6: 0x00007fff84509587 AppKit`-[NSView removeFromSuperview] + 465Any idea why would AppKit do this? Is there a way to avoid this?I can override -[NSView setLayer:] and do not assign nil layer there but it doesn't look like a good solution.
Posted
by vokbuz.
Last updated
.