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 NSMutableDictionary removeAllObjects does not free up used memory!
Ah, yes. This is the second time I fell into the same pit. The last time was years ago... Just hate this design by Apple, why a tight loop cannot have ARC automatically?
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’24
Comment on File name globbing in Swift
I am aware of Regex, but it's not the same as direct file pattern globbing. And for my case, I need to support older macOS versions (11+), but Regex is only available on macOS 13+.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Feb ’24
Comment on Can't get Xcode to parse the code in one file in editor
You don't need to start over again. What I meant was remove the file by reference from the project and add it back again. This should work.
Replies
Boosts
Views
Activity
Jan ’24
Comment on Unable to delete .com.apple.containermanagerd.metadata.plist file inside /Library/Containers/{YourApplicationFolder}.
Same problem here, macOS Sonoma 14.2.1.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Dec ’23
Comment on How display shortened path in a label?
Ah, I didn't notice there is this builtin property!
Topic: UI Frameworks SubTopic: AppKit Tags:
Replies
Boosts
Views
Activity
Dec ’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
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 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 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 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 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 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 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 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 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