Post

Replies

Boosts

Views

Activity

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
432
Mar ’23
How extract files in Assets.car?
I got a few answers from SO, but the tools are too old and they don't even run my macOS (12.6). Is there any official way to extract an Assets.car file? The reason I ask this question is that I want to re-use the icons for strings/storyboard files in Xcode packaged Assets.car (if it's legal).
0
0
1k
Sep ’23
Is it safe to call low level Darwin function on FileHandle?
I have the following code: extension FileHandle { func readInto(_ buffer: inout [UInt8]) -> Int { buffer.withUnsafeMutableBytes { Darwin.read(fileDescriptor, $0.baseAddress, $0.count) } } } It can compile, but I wonder if this is supported since it's code in an app that is going to be submitted to App Store. The reason I don't use read(upToCount:) or readData(ofLength:) is that I am reading possibly very large files by small chunks and don't want to let Swift runtime allocate small buffers repeatedly.
0
0
317
Nov ’23
TableView.makeView question
Is it possible that I bypass tableView.makeView so that I can create a NSTableCellView on the fly (based on some logics)? func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { if NSTableColumn.identifier.rawValue == "labelColumn" { let myCellView = NSTableCellView() myCellView.textField.strinValue = "label text" return myCellView } else { let complexView = loadFromNib() // of NSTableCellView // populate complexView return complexView } }
0
0
468
Jan ’24
How change NSTableView's width using code?
I calculate cell view's width in func tableView(_ tableView: NSTableView, sizeToFitWidthOfColumn column: Int). I have a need to resize the tableview's width to just match total width of all cell views' (without scrollbars). But it seems changing tableview's width does not work: tableView.bounds.size = CGSize(width: w, height: tableView.bounds.height) I suspect that I should change its clipping view or enclosing scrollview, but don't have any idea on this. Any help?
0
0
701
Mar ’24
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
540
Activity
Mar ’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:
Replies
0
Boosts
0
Views
432
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
724
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
An audacious idea - how implement the overlay like NSDatePicker?
I really like to implement an overlay that is similar with what we have in NSDatePicker: I know most of the time, we just use what Apple gives us behind the curtain, but I really want to know if this even possible. Thanks!
Replies
0
Boosts
0
Views
427
Activity
Mar ’23
Where is the Preview function in Xcode Version 14.2 (14C18)?
Xcode 14.2 is really crap. I cannot find the Preview function as what I have in previous version. I cannot find this menu item:
Replies
0
Boosts
0
Views
636
Activity
Apr ’23
Ventura has no default python installation?
I have not upgraded to Ventura yet. Yesterday one of my user (of one of my apps) mentioned that he has no Python environment on Ventura. Is it true?
Replies
0
Boosts
0
Views
367
Activity
Apr ’23
Is there any way to add new localizations using a command line tool?
I am reading "Managing Strings Files Yourself". Now the question arises in my mind. Is it possible to add new localizations using ibtool (or alike)? The reason I have this question is that I have a plan to build an app to automate strings localization so that I will be freed from tedious and repetitive work on translation.
Replies
0
Boosts
0
Views
426
Activity
Jul ’23
How extract files in Assets.car?
I got a few answers from SO, but the tools are too old and they don't even run my macOS (12.6). Is there any official way to extract an Assets.car file? The reason I ask this question is that I want to re-use the icons for strings/storyboard files in Xcode packaged Assets.car (if it's legal).
Replies
0
Boosts
0
Views
1k
Activity
Sep ’23
How to implement similar navigation bar like what we have in Xcode?
Can anyone give any clues about how the navigation bar is implemented like below?
Replies
0
Boosts
0
Views
454
Activity
Sep ’23
Is it safe to call low level Darwin function on FileHandle?
I have the following code: extension FileHandle { func readInto(_ buffer: inout [UInt8]) -> Int { buffer.withUnsafeMutableBytes { Darwin.read(fileDescriptor, $0.baseAddress, $0.count) } } } It can compile, but I wonder if this is supported since it's code in an app that is going to be submitted to App Store. The reason I don't use read(upToCount:) or readData(ofLength:) is that I am reading possibly very large files by small chunks and don't want to let Swift runtime allocate small buffers repeatedly.
Replies
0
Boosts
0
Views
317
Activity
Nov ’23
Any new URL for macappstore://itunes.apple.com/app/idxxx
I have used URL like "macappstore://itunes.apple.com/app/idxxx" in my apps for several years. Just curious to know if there is any update from this URL scheme? I believe iTunes is not app specific any more (or I am wrong).
Replies
0
Boosts
0
Views
515
Activity
Jan ’24
TableView.makeView question
Is it possible that I bypass tableView.makeView so that I can create a NSTableCellView on the fly (based on some logics)? func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { if NSTableColumn.identifier.rawValue == "labelColumn" { let myCellView = NSTableCellView() myCellView.textField.strinValue = "label text" return myCellView } else { let complexView = loadFromNib() // of NSTableCellView // populate complexView return complexView } }
Replies
0
Boosts
0
Views
468
Activity
Jan ’24
How change NSTableView's width using code?
I calculate cell view's width in func tableView(_ tableView: NSTableView, sizeToFitWidthOfColumn column: Int). I have a need to resize the tableview's width to just match total width of all cell views' (without scrollbars). But it seems changing tableview's width does not work: tableView.bounds.size = CGSize(width: w, height: tableView.bounds.height) I suspect that I should change its clipping view or enclosing scrollview, but don't have any idea on this. Any help?
Replies
0
Boosts
0
Views
701
Activity
Mar ’24
How reset the Collection list in font panel to default?
I accidentally removed the Fixed Width preset item in the font panel (by dragging it out). Is there any way to get it back?
Replies
0
Boosts
0
Views
725
Activity
Mar ’24