Post

Replies

Boosts

Views

Activity

Comment on Need help on Array and API design
Actually I think it's waste of both performance and space. I am aware that when I get a 'copy' of an array in Swift as long as I do not modify it, I actually get a special reference of the array. But when I modify it, the copy-on-write mechanism kicks in and I now get a copy. Later on, I have to replace the original array with the modified array. That's totally against my experience on other languages and systems. But, I know I cannot change anything.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’23
Comment on String interpolation produces a debug description for an optional value; did you mean to make this explicit?
The first method is tooooooooo verbose since I have to create an empty object. The second method is unsafe when obj is nil. What I wan is simple. print("object: \(obj)" should just print out either object: Lang:en name:(none) or object: or object: nil when the object is nil.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Linker errors in Swift app with a framework bundle
It's already listed under the section with "Embed & Sign"
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on How throw error in willSet
The special ! char denotes "Implicitly Unwrapped Optionals" which suits many scenarios.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’23
Comment on Is there any builtin Text Find Bar?
That's for iPhone. My app runs on macOS.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Get row index when user click a button in NSTableCellView
EDIT: Tag is simple, but it's readonly. I am just curious to know how to find the row of cell in the table?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Get row index when user click a button in NSTableCellView
I am not on iOS project, NSTableView does not have indexPath(for:) method, so I will stick to the tag thing.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Extension method for Optional of String
It's my fault. I did not read the article thoroughly. The article has example code which I did not observe.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Symbol navigator is polluted with thousands of system classes!
Yeah, that's fantastic! I seldom use the symbol navigator and when I tried to use it it demonstrated problems.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Any way to get array by reference?
This is just the situation where people feel helpless. We can't do anything to it. It's just by design. Another pain for me in Swift is that it does not explicitly support namespace. Apple is genius but sometimes they just fell asleep when making decisions.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Any way to get array by reference?
Thanks for your effort and replies. Sorry I cannot make your reply as answer because my question does not have an answer.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on Need help on Array and API design
Actually I think it's waste of both performance and space. I am aware that when I get a 'copy' of an array in Swift as long as I do not modify it, I actually get a special reference of the array. But when I modify it, the copy-on-write mechanism kicks in and I now get a copy. Later on, I have to replace the original array with the modified array. That's totally against my experience on other languages and systems. But, I know I cannot change anything.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’23
Comment on FileMerge won't run on macOS 12.7
Well yes, I think that is the reason. I did some hacking and I have been running Xcode 14.3.1 on macOS 12.7 for half a year.
Replies
Boosts
Views
Activity
Oct ’23
Comment on Common audio/image file extensions on macOS
My need is simple - search in some directories for certain types of files and process the result list.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’23
Comment on How parse byte size strings into actual number?
It seems that there is no builtin support for this purpose. I will write my own logics, anyway it's not difficult at all.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’23
Comment on GridView addRow height problem
I don't want to define it in IB. I want to dynamically add rows and define width and height.
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Dec ’23