I want to add a NSDatePicker in the sidebar of my app, to help select a date , or a range of dates. I could use the standard NSDatePicker, but it only seems to come in a single size, and doesn't seem to be resizable. I've dropped the NSDatePicker component into a xib file, and added auto-layout constraints, but they don't seem to work. Is there a way to make them respond to auto-layout and be resizable? Or should I be looking for 3rd-party frameworks to integrate with (if so, any recommendations)?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi,
I've been working with Core Data for a number of years, and I remember that when I needed to add attributes or entities to the data model, I had to first create a new model version, then add the new attributes/entities, and then use the "lightweight migration' flag when adding the NSPersistentStore to the NSPersistentStoreCoordinator. If it didn't add the new model version, the app would crash.
I've tried adding something to my data model now after a few years, without adding a new model version in Xcode. And right now, it seems to work fine. I can read/write to the new attribute that I added to an entity, and nothing crashed. I tried this on the simulator, as well as on my device.
Did something change at some point, where adding a new model version isn't a requirement for using lightweight migration? Or am I missing something? Why isn't it crashing anymore (and will it crash if I change my model without adding a new model version and ship it to production)?
Thanks.
Hi,
I just saw the "Use the camera for keyboard input in your app" talk, and had a question about it's capability that wasn't covered. From what I could tell, you have to designate a particular UITextField / UITextView as the 'target' (or is it 'responder'?). If I want to parse different types of content (name, email, phone number) into different UITextFields, for e.g to fill out a form ... how would that work? I don't want the user to launch the camera 3 times, one for each text field. Or would it be best to dump the contents into a UITextView and then have it parse the contents and detect the content types?
Thanks.
Hi,
I am using the (deprecated) UILocalNotification class in my app right now, because it fulfills a need that the UserNotification framework doesn't fulfill even 5 years after it was introduced. In my app, users can setup 'reminders' for different tasks, and those could be one-off tasks, or repeating tasks that start from a particular date/time. The UserNotifications system doesn't work with the latter requirement; it doesn't allow for you to setup a repeating alert which starts at a specific date/time. You can either setup a one-off alert in the future, or you can setup a repeating alert which starts as soon you set it up. As an example, I want to be reminded to call a friend of mine every week, from July 10th onward ... with the UserNotification framework, setting a 'repeat' will mean it'll fire an alert every week, starting from today.
So what's the best way to build a solution to this? Is there a way to 'intercept' the alert before it's shown (if it's before the date we want it to start firing)? Should I be looking at some 3rd-party services to do this remotely?
Thanks!
Hi,
With iOS15, is there still a limit for how many UserNotifications can be scheduled locally on a device? A lot of places suggest that the limit is for 64 notifications at a time, and this limit has been there since UILocalNotifications were a thing. Has that changed at all? Considering that modern devices are so much more powerful than in the past, one would imagine that they should be handle more than a few local notifications in the system.
I filed a Radar for this 5 years ago, which was changed to this Feedback Request: FB5978935
If we are presenting a sheet controller without any dimming view, would we be able to drop drag-and-drop between the sheet view and the presenting view controller (if the views themselves supported drag-and-drop)?
Thanks.
I want to use the "SF Pro Text" font in my app. It works fine when I build my app on my main computer running macOS11 Big Sur, but I have a 2nd partition to run macOS Monterey, and it doesn't seem to be available there at all, whether through Interface Builder or through code (using NSFontManager).
Using this returns nil on my Monterey partition:
NSFont* regularFont = [[NSFontManager sharedFontManager] fontWithFamily:@"SF Pro Text" traits:NSFontWeightRegular weight:5 size: 16.0];
Maybe I'm missing something here ... should I have to install the font manually? I thought the SF Font is a 'system font', so it would be available on all Macs?
Hi,
I haven't been able to add some basic SiriKit actions to my macOS app in macOS Monterey. To test this out, I created a new project, made it a macOS app with Storyboard. Then I added an intents definition file, and added a basic intent, with no inputs/outputs. I added the intent name to "Supported Intents" in the target "General" configuration.
Now when I build and run the app, the shortcut doesn't show up in the Apple Shortcuts app. I've tried looking for the "Siri" capability in "Signing & Capabilities" and it's not listed there (compared to a new iOS app where it would be).
I'm not sure what I'm missing here. Would love some help.
I'm using Xcode 13.1 on macOS Monterey RC.
Hi,
My Mac app saves it's local database and other important information in the Application Support directory. I want to now create an Intents extension for the app so I can create shortcut actions. When I currently run this, the Application Support directory for the extension is different than for the main application.
Is there any way on macOS for the extension to access it's parent applications App Support directory? I know it's not possible in iOS, and you have to use App Groups for this, but I'm wondering about the Mac. BTW, the app is a sandboxed app for the Mac App Store.
I am building a widget for my (AppKit) Mac app, and one thing I can't figure out is how to detect when a Link is pressed in the widget to open the parent app. It just opens the parent app but I can't get any information about the URL that was passed in. With iOS, it's easy to detect, from the AppDelegate method:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
I can't find anything equivalent on macOS. Can someone point me to the right place?
Hi,
I am trying to invoke this NSApplicationDelegate callback from my Mac app, but it's not getting called:
- (void)application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls
I have registered the URL scheme in my Info.plist:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.my.testapp</string>
<key>CFBundleURLSchemes</key>
<array>
<string>mytestapp</string>
</array>
</dict>
</array>
Now I use a 2nd Mac app to test this out, by invoking the following code:
if let url = URL(string: "mytestapp://") {
NSWorkspace.shared.open(url)
}
This causes my first app to come to the foreground, and the
"applicationDidBecomeActive:(NSNotification *)notification" method gets called, but the "application:(NSApplication *)application openURLs:(NSArray<NSURL *> *)urls" method mentioned above doesn't get invoked, which is what I want.
Any ideas about why that might be the case?
Hi,
I have a paid app available through the Mac App Store, and when the user opens the app, I want to verify that the transaction of the payment is valid. I would have assumed that in StoreKit2, the 'Transaction.all' would work, but when I tested this, it shows 0 transactions for all users.
This is what I'm testing:
for await result in Transaction.all {
guard case .verified(let transaction) = result else { continue }
print("verified product = \(transaction.productID)")
// send to analytics
}
But nothing gets observed in the analytics.
Does the StoreKit2 framework have an easy way to determine transactions that are made for paid-up-front apps?
Hi,
Is DataScannerViewController available to be called directly from Objective-C? I see the header file has an "objc" attribute on it, but trying to initialize it from an Objective-C file doesn't seem to be working for me. Maybe it's something I'm doing wrong, but I wanted to first clarify and confirm that if it indeed possible to use it directly in Objective-C, or not?
The iPhone 14 Pro has a A16 Bionic chip with 16 Billion transistors, two performance cores + 4 high-efficiency cores, a 5-core GPU and 16-core neural engine, and can perform 4 trillion OPS per photo. But sadly, we can only schedule up to 64 User Notifications on it (per app). This limitation has been there since iOS3 I believe, when UILocalNotifications were first introduced, along with the iPhone 3G.
What gives? Why does this limit never seem to change? I would love to understand the reasons. I am trying to build a 'timer' app, and can't understand how to build one with this limitation in place (unless I use Remote Push notifications, which requires a lot of infrastructure outside the app).
Btw, I filed a Radar for this 5 years ago, which was changed to this Feedback Request: FB5978935
Hi,
With StoreKit2 giving us the up-to-date subscription status using Transaction.currentEntitlements, is there any value in storing the status separately in keychain as well? Or will that just add an unnecessary layer to manage (and possibly mess up)? I just want to subscription status to know if I need to unlock certain features in the app or not, and wondering if just looking at currentEntitlements and saving that in my Store object is enough.
Thanks.