Post

Replies

Boosts

Views

Activity

NSTableView doesn't update row height while typing in NSTextField inside a cell
So I have an NSTableView with automatic row heights whose cells contain a self-sizing NSTextField. The row height adjusts after I finish typing in NSTextField (press enter), but not during, and I need it to adjust during typing as well. Here's the code for the self-sizing NSTextField: override var intrinsicContentSize: NSSize { 		// Guard the cell exists and wraps 		guard let cell = self.cell, cell.wraps else {return super.intrinsicContentSize} 		// Use intrinsic width to jive with autolayout 		let width = super.intrinsicContentSize.width 		// Set the frame height to a reasonable number 		self.frame.size.height = 750.0 		// Calcuate height 		let height = cell.cellSize(forBounds: self.frame).height 		return NSMakeSize(width, height); } override func textDidChange(_ notification: Notification) { 		super.textDidChange(notification) 		super.invalidateIntrinsicContentSize() } The only customization for NSTableView is this line: tableView.usesAutomaticRowHeights = true Thanks in advance!
0
0
800
Jul ’20
How to sync widgets in background with data in Core Data and CloudKit?
I have an app that shows some data in a widget. When that data is changed on another device, it's supposed to sync to the current device, which works fine. But the widget doesn't sync until I send the app into foreground (and then the sync happens), which is bad because the widget data should always be up-to-date. I'm using this Apple guide - https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit to sync Core Data and CloudKit with slight modifications. How can I sync widgets in the background? Thank you in advance!
3
0
2k
Aug ’20
Provisioning profile doesn't support the HealthKit capability, doesn't include com.apple.developer.healthkit and com.apple.developer.healthkit.access entitlements. Your account does not have sufficient permissions to modify containers.
When I try to add HealthKit capabilities to my app, I get the following signing errors: Communication with Apple failed. Your account does not have sufficient permissions to modify containers. Provisioning profile "iOS Team Provisioning Profile: com.domain.app" doesn't support the HealthKit capability. Provisioning profile "iOS Team Provisioning Profile: com.domain.app" doesn't include the com.apple.developer.healthkit and com.apple.developer.healthkit.access entitlements. In my developer account, the HK capability is enabled. And the entitlements needed are automatically generated by Xcode when I add HK capability, if I try to add them, it says they're already there. I have automatically managed signing selected. Clinical health records are not enabled for Health Kit. Common solutions like cleaning, derived data, and restarts don't help. Does anybody know what this is?
2
1
2.2k
Jul ’21