Post

Replies

Boosts

Views

Activity

How to identify the first desktop (space)?
My app observes NSWorkspaceActiveSpaceDidChangeNotification and set wallpaper on the active screen. But I see there is no way to distinguish between spaces on a screen. I'm not sure if I have read the docs thoroughly. I would like to know if it is possible to tell which space is active for the active screen.
Topic: UI Frameworks SubTopic: AppKit Tags:
1
0
917
May ’22
Playground starts slowly or never runs
I am a little hesitant to ask this question because it's been years, during which I hoped it's just a specific problem of my own computer or Xcode version. I'm not sure if it's only me alone with this problem. First time run of any playground project is extremely slow (after I open it); sometimes it just never runs with the build indicator circling forever). This is true for objc or swift playgrounds, or different machines, different Xcode versions, different OS versions. Can anyone help?
2
0
1.7k
Feb ’22
Strange debug output with command line gcc
When I log in and start a Terminal window, a simple gcc command produces the following debug messages: 2022-07-15 13:52:41.470 xcodebuild[784:10833] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore 2022-07-15 13:52:41.470 xcodebuild[784:10833] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore Subsequent invoke of gcc does not produce these messages. How to avoid this small nuisance?
1
0
618
Jul ’22
NSView and dynamically created subviews
I have a custom view that acts as a container for many NSImageViews that will be created dynamically on the fly. When the container view is resized (by parent window), some new subviews may be created and added to the container view, or some subviews may be removed because they are not fit into a smaller view. I have two ways to handle the 'disappearing' subviews. One way is to hide them, the other is to remove them from the container view. My concern is that - Is there a (big) performance difference between the two methods? Which is better?
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
408
Mar ’23
How can I know when an NSTextField gets input focus (first responder)?
I think I can do this by creating a custom view overriding the following 2 methods: @implementation MyTextField - (BOOL)becomeFirstResponder { NSLog(@"%s: %@", __func__, self); return [super becomeFirstResponder]; //return YES; } - (BOOL)resignFirstResponder { NSLog(@"%s: %@", __func__, self); return [super resignFirstResponder]; //return YES; } @end But there is a gotcha - I always get successive become/resign. That is when I get becomeFirstResponder, I also get resignFirstResponder immediately. Note - I only have one MyTextField instance on my window. Is there another safe way to achieve my goal?
1
0
737
Mar ’23
KVO addObserver:forKeyPath not working
This is the first time I use KVO pattern. The code is quite simple but I could not get it working - the log method never gets run. What's wrong with my code? @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; [self.view.window addObserver:self forKeyPath:@"firstResponder" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld context:nil]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context { NSLog(@"%@", change); } @end
1
0
650
Mar ’23
Quick Help always stops working after debugging
I have an annoying problem with Xcode 14.2. After opening a project, Quick Help pane works normally. But once a debugging session ends, it stops working (showing nothing). Meanwhile ALT+CLICK won't work either (no response). After closing and re-opening the project Quick Help works again. Is there any workaround for this nuiance? I already went back to 13.14.1.
1
0
298
Apr ’23
IB_DESIGNABLE and dylib problem
My app has 2 dylibs linked, in build settings run path is set to "@executable_path/../Frameworks" and a copy file rule is also there. The app runs fine for years now (in App Store). But once I turn on IB_DESIGNABLE for a custom view, IB reports errors like below: It seems IB tries to load the dylibs from somewhere in Xcode.app. What should I do in order to get IB_DESIGNABLE to work in IB?
2
0
716
Apr ’23
How stop Xcode from autogenerating application entitlement for dylib?
I am in peril. Can anyone save me. I am desperate! I am using Xcode Version 14.2 (14C18) to build my 2 dylibs. I had no problems with older versions of Xcode (one and half a year ago). But it's causing code signing problems and Connect fails my submitted binary package complaining I had wrong entitlement on dylibs. I contact Apple technical support and I got a reply: Entitlements are only effective on a main executable. When you sign a shared library with entitlement then, at best, the system ignores them. However, in some cases you can run into mysterious problems like this one. The key problem is that Xcode is autogenerating entitlement file for my dylibs. I have no entitlement files in my projects, I am sure. codesign -d --ent - libsqlite3s.dylib Executable=/Users/USERNAME/Library/Developer/Xcode/DerivedData/libsqlite3s-ahztenmeyvsijneqjzdtifjhljlr/Build/Products/Debug/libsqlite3s.dylib [Dict] [Key] com.apple.application-identifier [Value] [String] TEAMID.net.neolib.libsqlite3s How can I turn off this 'useful' feature?
1
0
643
Apr ’23