After force quitting Xcode, restarting my iMac, opening Xcode, it never opens, and watching it on Activity Monitor, it shows up, but then turns red as not responding x2. Sounds like my Xcode app is hosed or it is still trying to verify the simulator runtime???
I'm not sure how to completely delete and reinstall Xcode and get rid of whatever is causing it keep verifying the runtime.
Post
Replies
Boosts
Views
Activity
Yes, thank you ZackJarret. I had that ".identifier" in one permutation but not with (__bridge CFStringRef) (because I got another warning saying it could not bridge or something earlier - again I'm clueless).
And in the dictionary code, adding ".identifier" as a simple NSString was enough to make it all work.
FWIW, I did try chatGPT with three goarounds and finally it came up comments below. I'm glad you're human.
In recent macOS SDKs, UTTypeJPEG is deprecated, and you should use kUTTypeJPEG instead. If you're seeing a warning, it's generally safe to ignore it in this case because kUTTypeJPEG is the correct constant to use on macOS.
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CGImageDestinationRef destinationRef = CGImageDestinationCreateWithURL((__bridge CFURLRef)theURL, kUTTypeJPEG, 1, NULL);
#pragma clang diagnostic pop
I have a MacOS app in the store that tries to address the issues related by starkadhr, and some potential customer (probably some Unix guy) asked whether the app could change the creation date/year of, again, scanned photos before 1/1/1970. No. With Eskimo's reservations about changing creation dates noted, I changed the creation date my old-fashioned way in ObjC (I don't do Swift - I'm passed my prime since I had one of the first 500 apps in the app store).
NSDictionary *fileDict = [NSDictionary dictionaryWithObjectsAndKeys:createDate, NSFileCreationDate, modDate, NSFileModificationDate, nil];
[[NSFileManager defaultManager] setAttributes:fileDict ofItemAtPath:[self.urlForCurrentImage path] error:nil];
I'm wondering if this ObjC code below will work with earlier dates than 1970 or is this still using setFile/old Unix code somehow?
- (BOOL)setUnixSafeFileCreationDate:(NSDate *)date fileURL:(NSURL *)url {
NSError *error = nil;
BOOL success = [url setResourceValue:date
forKey: NSURLCreationDateKey
error:&error];
if (!success) {
NSLog(@"NSURLCreationDateKey error: %@", error);
return false;
} else {
return true;
}
}
So, I had a similar circular warning for this same method where I wanted to identify a JPG or a PNG image and create an image with the appropriate extension. Although a good example of how to use it was not clear to me and here's what worked for me (Objective C).
Import the newer identifiers:
@import UniformTypeIdentifiers;
Create a property to hold the identifiers:
@property (strong) NSString *imageType;
Assign one of the identifiers to the property:
if ([theImageExtension isEqualToString:@"png"]) {
_imageType = (NSString *)UTTypePNG.identifier;
} else {
_imageType = (NSString *)UTTypeJPEG.identifier;
}
Use it:
CGImageDestinationRef destinationRef = CGImageDestinationCreateWithURL((__bridge CFURLRef)theURL, (CFStringRef)_imageType, 1, NULL);
And that worked! (after many permutations)
BTW, I also took a completely empty (no additional code, nothing added to blank xib) Automator Action template (found in MacOS) in Xcode 13.2.1 and followed the Technical Q&A QA1885 exactly and still get this error.
Force Quit Xcode, restarted, opened project. Fixed. Thanks everyone.
The documentation still says to select checkboxes for each family of complications BUT that is outdated for Xcode 12.3. I think I found only one line in thousands from WatchOS that, now, you need to add a key to Info.plist for the extension named ClockKit Complication - Supported Families and add Modular, Circular, etc. to that key.
No extra coding just template/glyphs in the right sizes for each sub-family.