Post

Replies

Boosts

Views

Activity

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
How throw error in willSet
I have the following code: public var endpoint: String! { willSet { if newValue == nil { throw ErrorCode.NullValue("endpoint") } } } But compiler gives me error: Error is not handled because the enclosing function is not declared 'throws'
3
0
791
Aug ’23
switch case and === operator
I have the following code: func numberOfRows(in tableView: NSTableView) -> Int { switch tableView { case self.stringsTable: return self.stringsList?.count ?? 0 case self.localeTable: return self.localeMap.count default: print("numberOfRows not handled for \(tableView)") return 0 } } I wonder if there is any (performance) difference between case and ==== operator like below: func numberOfRows(in tableView: NSTableView) -> Int { if tableView === self.stringsTable { } // ... }
3
0
490
Sep ’23
How include dSYM when I build my Framework project?
This question is related to this post (of mine). It seems default build settings do not include dSYM files needed when uploading embedding app package. But now Xcode issues new warnings about this. Now the question - how do I tell Xcode to create dSYM files for me, say when I build My.Framework? I asked AI chatbot which tells me that for release build I need to : set "Debug Information Format" to DWARF set "Strip Debug Symbols During Copy" to off I have item 1 turned on (which I believe is the default). But item 2 is on, maybe that's the reason I do not have dSYM files in final built My.Framework. Should I turn "Strip Debug Symbols During Copy" off?
3
0
196
Apr ’25
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
Swift project build process is extremely slow after upgrading to 16.3
For an initial launch of Xcode, the GatherProvisioningInputs usually takes 60 seconds for a simple project. Subsequent build is fast though. But the build process seems got stuck at VeryModule of the MyFramework target, which usually takes 15 seconds.
Replies
2
Boosts
1
Views
135
Activity
May ’25
Does Xcode 26 only run on the new macOS 26?
I currently do not want to upgrade to macOS 26, but I still want to install the latest Xcode. Is it required to install macOS 26 if I were to get Xcode 26?
Replies
2
Boosts
0
Views
317
Activity
Sep ’25
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
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
How "Show in Finder" works in Xcode?
I want to add "Show in Finder" in my app that is similar to the one in Xcode. How do I do this using objc?
Replies
3
Boosts
0
Views
660
Activity
Mar ’23
How throw error in willSet
I have the following code: public var endpoint: String! { willSet { if newValue == nil { throw ErrorCode.NullValue("endpoint") } } } But compiler gives me error: Error is not handled because the enclosing function is not declared 'throws'
Replies
3
Boosts
0
Views
791
Activity
Aug ’23
switch case and === operator
I have the following code: func numberOfRows(in tableView: NSTableView) -> Int { switch tableView { case self.stringsTable: return self.stringsList?.count ?? 0 case self.localeTable: return self.localeMap.count default: print("numberOfRows not handled for \(tableView)") return 0 } } I wonder if there is any (performance) difference between case and ==== operator like below: func numberOfRows(in tableView: NSTableView) -> Int { if tableView === self.stringsTable { } // ... }
Replies
3
Boosts
0
Views
490
Activity
Sep ’23
Does Swift support number suffixes?
In C++, I can write 123457890ull to imply it's an unsigned long long integer. Does Swift provide similar language construct?
Replies
3
Boosts
0
Views
691
Activity
Nov ’23
App upload warnings (never seen before)
I don't get any idea why I am getting the following warnings when I tried to upload one of my apps:
Replies
3
Boosts
0
Views
159
Activity
Apr ’25
How include dSYM when I build my Framework project?
This question is related to this post (of mine). It seems default build settings do not include dSYM files needed when uploading embedding app package. But now Xcode issues new warnings about this. Now the question - how do I tell Xcode to create dSYM files for me, say when I build My.Framework? I asked AI chatbot which tells me that for release build I need to : set "Debug Information Format" to DWARF set "Strip Debug Symbols During Copy" to off I have item 1 turned on (which I believe is the default). But item 2 is on, maybe that's the reason I do not have dSYM files in final built My.Framework. Should I turn "Strip Debug Symbols During Copy" off?
Replies
3
Boosts
0
Views
196
Activity
Apr ’25
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
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
Which version of Xcode works best with macOS 12 (Monterey)?
I am currently using Xcode 14.2 (14C18), but it has some glitches (which I don't want to enumerate here). I now want to revert back to an earlier older version. Any suggestions?
Replies
4
Boosts
0
Views
1.6k
Activity
Mar ’23
chevron.down.square.fill image name
I cannot find any docs on this image name but I can select it from the dropdown list in IB. What is the mim macOS version for this name?
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
4
Boosts
0
Views
1.2k
Activity
Mar ’23
How display shortened path in a label?
I have a single-line label whose purpose is display file path, possibly very long. Is there any way to shorten/compact the path string (with ellipse ...) so that the label still displays full path even it's too long? Like below: /some/very/long/path/to/some/filename.txt to /some/.../filename.txt
Replies
4
Boosts
0
Views
783
Activity
Jan ’24