How do you use the delegate? When I implement the delegate , I get an error in my AppName-Swift.h file.
I have a Swift class that I've implemented to be the delegate for ImagePlaygroundViewController. Unless there's a way to access it directly from Objective-C. I figured I'd use an intermediate Swift class and then just pass the selected image to my Objective-C view controller.
This is an AppKit app. Mostly in Objective-C, but with sprinkles of Swift and SwiftUI here and there.
I've implemented the delegate and all the required methods.
@objc public class TFImagePlaygroundManager: NSObject, ImagePlaygroundViewController.Delegate
This error is what I get:
Cannot find protocol declaration for 'ImageGenerationViewControllerDelegate'; did you mean [some other delegate]
Is it not posible to use Image Playground in a mixed Swift / Objective-C Mac AppKit app?
This is the code that's auto-generated inside my AppName-Swift.h file:
@interface TFImagePlaygroundManager : NSObject <ImageGenerationViewControllerDelegate>
- (void)imagePlaygroundViewController:(ImagePlaygroundViewController * _Nonnull)imagePlaygroundViewController didCreateImageAt:(NSURL * _Nonnull)imageURL;
- (void)imagePlaygroundViewControllerDidCancel:(ImagePlaygroundViewController * _Nonnull)imagePlaygroundViewController;
- (nonnull instancetype)initWithDelegate:(id <TFImagePlaygroundDelegate> _Nonnull)delegate OBJC_DESIGNATED_INITIALIZER;
- (void)showImagePlaygroundFromController:(NSViewController * _Nonnull)controller;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end
Post
Replies
Boosts
Views
Activity
This is happening to me in production, but not the development environment. CloudKit Dashboard also display an error when I try to query the affected Record Type. Any proper solution to this scenario? Ok in Development, fails in Production?
I'm not using a VM. It worked before in the beta Sequoia and beta Xcode 16. But no longer since the RCs.
I have the same issue, but on a real device. Not using the simulator. Did you find a solution?
I'm using NSTableViewDiffableDataSource and as soon as I import a bunch of records (not even that many - like 600), I get the error if I have animations turned on.
[self.tableDiffableDataSource applySnapshot:snapshot animatingDifferences:YES completion:^{
}];
But as soon as I turn OFF animatingDifferences, I no longer get the error.
I had this same problem, but as soon as I uncommented out this code and ran my app, while connected to the Production CloudKit container, it started to work. I thought you only had to do it one time on the Development container and then publish to production in the CloudKit Dashboard. Once I let this code run one time, after that it all started to work.
do {
// Use the container to initialize the development schema.
try container.initializeCloudKitSchema(options: [])
} catch {
// Handle any errors.
print(error)
}
#endif
Well I know this is 5 years old, but I'm just running into this issue now. Did you ever find a solution? I have an NSTreeController bound to a Swift array and I get the same crash. This time on macOS Monterey.
Well it turns out it was saving the binary data. I still get the file not found error though, but perhaps it's harmless. I wasn't seeing the photo I was saving appear due to a cacheing mechanism I had. I was forgetting to clear the cache after I added new images. So new images weren't showing up. It's all good.
This is also happening to me. It happened to me after I upgraded to macOS 11 Beta 10, but before Xcode 12.2 Beta 3. I was still on Beta 2 when I first saw the crash. So then I upgraded to Xcode 12.2 Beta 3 and it still crashes.
I knew it had to be something with the debugger because I could launch the built application from the Finder, but not from within Xcode.
Thanks for the workarounds. At least I can run now.
I'm in the same boat.
But I have a hierarchical relationship with 3 different entities:
CDCategory ->> CDForm ->> CDSearch ->> CDSearch
A Search can have a list of child Searches and a Search can represent a folder. So basically any number of nested folders/searches.
For example:
> Personal (CDCategory)
> My Movie Library (CDForm)
> Searches by Genre (CDSearch with isFolder = true)
Action Movies (CDSearch)
Comedies (CDSearch)
and so on.
I can't seem to get OutlineGroup to handle this. The first issue is the error about NSSet not being the required Set<Form>, etc. To get around that I'm using
Array(category.forms as! Set<CDForm>)
I use that with List but I can't seem to use it with OutlineGroup because when I provide the children key path, I get that similar error:
Key path value type 'NSSet?' cannot be converted to contextual type '[CDSearch]?'
I've looked around for examples that use OutlineGroup with Core Data but haven't found anything yet.
OutlineGroup(Array(form.searches as! Set<CDSearch>), id: \.uuid, children: \.searches) { (search : CDSearch) in
SearchRow(search: search)
}