I once posted a question in the forums, but it seems I cannot find the thread now (maybe the thread was before the new forums was born).
I don't know why I am so confused about this directive (or whatever):
It looks like a compiler directive because it has a specific syntax.
But it also looks like it's a runtime check because it is used in if statement (not in #if).
So my question is:
Given the following code:
if (@available(macOS 13.0, *) {
NSLog("Running on macOS Ventura or later")
} else {
NSLog("Running on older version before Ventura")
}
Does this directive check real macOS version during runtime?
Post
Replies
Boosts
Views
Activity
I submitted a test package and got the following email:
ITMS-90345: Metadata/Info.plist Mismatch - The value for bundle_identifier in the metadata.xml file does not match the value for CFBundleIdentifier in test [net.neolib.test.pkg/Payload/test.app].
I really don't have any idea what's wrong. It's a simple (almost blank) app with nearly no modification (except linked with a dylib).
What is the metadata.xml? I cannot find it in my test project.
It seem Apple is forcing developers to use new Xcode 14.3 and Ventura. I am having various rudimentary problems with Xcode 14.2.
Today I created a new project and was surprised to find out that there is Info.plist in the project. I have to copy one from an older project.
I am wondering if Xcode 14.3 does the same thing (not creating Info.plist). Or I am quite behind the trend because I had not updated my apps for more than a year.
EDIT:
Why PRODUCT_BUNDLE_IDENTIFIER is invalid?
My app has 2 dylibs linked, in build settings run path is set to "@executable_path/../Frameworks" and a copy file rule is also there. The app runs fine for years now (in App Store).
But once I turn on IB_DESIGNABLE for a custom view, IB reports errors like below:
It seems IB tries to load the dylibs from somewhere in Xcode.app.
What should I do in order to get IB_DESIGNABLE to work in IB?
I really need help. Can anyone decrypt the following message for me:
Dear Developer,
We identified one or more issues with a recent delivery for your app, "MYAPP" 2.0 (1200). Please correct the following issues, then upload again.
ITMS-90288: Invalid Code Signing Entitlements - The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: '' for the key 'com.apple.application-identifier' in 'MYAPP.app/Contents/Frameworks/libsqlite3s.dylib'
ITMS-90286: Invalid Code Signing Entitlements - Your application bundle's signature contains code signing entitlements that are not supported on macOS. Specifically, value '' for key 'com.apple.application-identifier' in 'MYAPP.app/Contents/Frameworks/libsqlite3s.dylib' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier .
The 2 dylibs are built by myself and for years I did not have this problem with submission. What should I do? Although I know something is wrong with entitlements/signature, but I have no clue at all on what I need to exactly.
I target my project to macOS version 10.10. Now I have an NSStackView in IB and I can set its distribution property in the inspector pane. But there is a yellow warning saying that the distribution property is available only on 10.11+.
My question is - will my app crash if it runs on macOS 10.10?
I have an annoying problem with Xcode 14.2. After opening a project, Quick Help pane works normally. But once a debugging session ends, it stops working (showing nothing). Meanwhile ALT+CLICK won't work either (no response).
After closing and re-opening the project Quick Help works again.
Is there any workaround for this nuiance? I already went back to 13.14.1.
I cannot find any docs on this image name but I can select it from the dropdown list in IB. What is the mim macOS version for this name?
This is the first time I use KVO pattern. The code is quite simple but I could not get it working - the log method never gets run. What's wrong with my code?
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self.view.window addObserver:self
forKeyPath:@"firstResponder"
options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld
context:nil];
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary<NSKeyValueChangeKey,id> *)change
context:(void *)context
{
NSLog(@"%@", change);
}
@end
I think I can do this by creating a custom view overriding the following 2 methods:
@implementation MyTextField
- (BOOL)becomeFirstResponder {
NSLog(@"%s: %@", __func__, self);
return [super becomeFirstResponder];
//return YES;
}
- (BOOL)resignFirstResponder {
NSLog(@"%s: %@", __func__, self);
return [super resignFirstResponder];
//return YES;
}
@end
But there is a gotcha - I always get successive become/resign. That is when I get becomeFirstResponder, I also get resignFirstResponder immediately. Note - I only have one MyTextField instance on my window.
Is there another safe way to achieve my goal?
I really like to implement an overlay that is similar with what we have in NSDatePicker:
I know most of the time, we just use what Apple gives us behind the curtain, but I really want to know if this even possible. Thanks!
I am currently using Xcode 14.2 (14C18), but it has some glitches (which I don't want to enumerate here).
I now want to revert back to an earlier older version. Any suggestions?
I want to add "Show in Finder" in my app that is similar to the one in Xcode. How do I do this using objc?
In IB I connect a button to a VC and set the segue kind to 'Popover'. Now I have a problem. How do I get the NSPopover and its delegate?
-(void)prepareForSegue:(NSStoryboardSegue *)segue sender:(id)sender {
NSLog(@"%s: %@", __func__, segue.destinationController);
NSViewController* vc = segue.destinationController;
}
I am aware of the following approach:
Add a custom view into a view in IB.
Set the class of this custom view, say "MyDatePickerView".
Now my datepicker view has a moderate complex UI, and I want to isolate its functionalities into a standalone XIB. Is it possible to do this in IB (I know I can do it in code)?