Post

Replies

Boosts

Views

Activity

How detect SDK version
I have the following code:@implementation NSWindow (Coordination) - (NSPoint)convertPointFromScreen:(NSPoint)point { NSRect rect = NSMakeRect(point.x, point.y, 1, 1); return [self convertRectFromScreen:rect].origin; }I get a compiliation warning:Category is implementing a method which will also be implemented by its primary classI know Swift has builtin preprocessor directives to detect SDK version, but don't know how to do this in objc. Any suggestions?
6
0
8.1k
Nov ’21
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
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
939
May ’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
633
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
431
Mar ’23
Need a (simple) algorithm to tell if 2 images differ
I have a need to tell if 2 images are different by unimportant details. For example, one image is only slightly different than another because: *) It is a little stretched *) or it has 99% portion of another (only missing some pixels on borders) I wonder if there is an efficient algorithm to achieve my goal. Any suggestions are welcome.
3
0
2.3k
Mar ’23
Standard Value is disabled in Xcode 13
I'm not sure what I have missed in the new release, but I cannot set Standard Value in IB anymore like that I did for years. The Standard Value is disabled in constraint dropdown list. If I clear the hardcoded value, "Standard" will appear but when I press ENTER, the old value comes back. Is this a known bug or a new 'feature'?
Replies
1
Boosts
0
Views
662
Activity
Oct ’21
How enlarge doc text size?
On my 27in monitor, the doc text is too small for reading. Is there any way to enlarge text size? Maybe I should file a ticket to request for a new feature for this?
Replies
1
Boosts
0
Views
569
Activity
Oct ’21
How detect SDK version
I have the following code:@implementation NSWindow (Coordination) - (NSPoint)convertPointFromScreen:(NSPoint)point { NSRect rect = NSMakeRect(point.x, point.y, 1, 1); return [self convertRectFromScreen:rect].origin; }I get a compiliation warning:Category is implementing a method which will also be implemented by its primary classI know Swift has builtin preprocessor directives to detect SDK version, but don't know how to do this in objc. Any suggestions?
Replies
6
Boosts
0
Views
8.1k
Activity
Nov ’21
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?
Replies
2
Boosts
0
Views
1.7k
Activity
Feb ’22
Can I use libraries from brew.sh in my app?
I have a need to integrate icu (https://formulae.brew.sh/formula/icu4c#default) into one of my store apps. I'd like to know if this approach is supported by the app submission policies. Thanks.
Replies
1
Boosts
0
Views
670
Activity
Mar ’22
How disable locate service?
I once enabled locate (not location) service but now I want to disable/remove it. It's really not very helpful compared to spotlight. What is the correct commandline?
Replies
0
Boosts
0
Views
539
Activity
Mar ’22
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:
Replies
1
Boosts
0
Views
939
Activity
May ’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?
Replies
1
Boosts
0
Views
633
Activity
Jul ’22
App running shell script question
I want to use NSTask to run a shell script that resides in Resouces directory. The script performs some operations on files in the app's Data directory.But I am concerned that Apple could refuse my app for some reasons. Can anyone confirm if this approach is safe. Thanks.
Replies
7
Boosts
0
Views
5.5k
Activity
Jan ’23
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:
Replies
0
Boosts
0
Views
431
Activity
Mar ’23
How create thumbnail from NSImage?
I did searches on the Internet but could not find a definitive answer. The best thing I get is CGImageSourceCreateThumbnailAtIndex API function. But I don't know how create CGImageSource out of an NSImage object. Thanks for any suggestions.
Replies
0
Boosts
0
Views
723
Activity
Mar ’23
Need a (simple) algorithm to tell if 2 images differ
I have a need to tell if 2 images are different by unimportant details. For example, one image is only slightly different than another because: *) It is a little stretched *) or it has 99% portion of another (only missing some pixels on borders) I wonder if there is an efficient algorithm to achieve my goal. Any suggestions are welcome.
Replies
3
Boosts
0
Views
2.3k
Activity
Mar ’23
NSObject isEqual: vs isEqualTo:
Got confused about these 2 methods. NSObject protocol has an isEqual: method. NSObject implements NSObject protocol but it does not have isEqual:, instead it has an isEqualTo: method. What's the magic behind the design? Or is the doc wrong? Should I implement both methods in a derived class?
Replies
1
Boosts
0
Views
843
Activity
Mar ’23
Add XIB custom view as a subview of another view in Interface Builder
I am aware of the following approach: Add a custom view into a view in IB. Set the class of this custom view, say "MyDatePickerView". Now my datepicker view has a moderate complex UI, and I want to isolate its functionalities into a standalone XIB. Is it possible to do this in IB (I know I can do it in code)?
Replies
0
Boosts
0
Views
496
Activity
Mar ’23
How do I control popover invoked by segue?
In IB I connect a button to a VC and set the segue kind to 'Popover'. Now I have a problem. How do I get the NSPopover and its delegate? -(void)prepareForSegue:(NSStoryboardSegue *)segue sender:(id)sender {     NSLog(@"%s: %@", __func__, segue.destinationController);     NSViewController* vc = segue.destinationController; }
Replies
3
Boosts
0
Views
672
Activity
Mar ’23