I am forced to use an NSMutableArray and populate it using a loop:
- (instancetype)initWith:(NSUInteger)capacity rolling:(BOOL)rolling {
_list = [NSMutableArray arrayWithCapacity:capacity];
// Populate the array with all NSNull values.
for (NSUInteger i = 0; i < capacity; i++)
[_list addObject:NSNull.null];
}
Post
Replies
Boosts
Views
Activity
Yes, this is just what I want. I wanted the experts to confirm that private and fileprivate at file level work the same way.
BTW, I am quite familiar with private modifier inside enum/class/struct definitions.
I cannot access private or fileprivate vars in another file right? So what's the difference?
The info in the language reference does not explain what's the difference.
It seems when used in file level private is same as fileprivate:
class SandBoxVC: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()
print(aaaa, bbbb) // no compiler error here
}
}
fileprivate let aaaa = 1234
private let bbbb = "bbbb"
I almost believe this is an oversight bug in Swift compiler - private should not be used in file level.
That SO thread is about a custom X button. I want to know if there is any way to hook up the action of the system X button.
I also found out this soon after I posted my question:
[NSRunLoop.currentRunLoop run];
I tend to use your answer after reading docs because NSPanel offers more features that are just what I need for a "preview" window.
I am on Appkit, it seems NSScrollView does not have onChange event, and I cannot find any properties/notifications that can tell me the current scroll position. That's odd.
I don't believe it's a bug. It's simply that I didn't know where to find the predefined key codes. import Carbon.HIToolbox does the job.
Ah, English is not my native language. And any legal documentation is cryptic to me, I can never understand them, even if they are written in my native language.
That's the missing little piece...
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?
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+.
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.
Same problem here, macOS Sonoma 14.2.1.