Post

Replies

Boosts

Views

Activity

HMPresenceEvent-based predicate woes
I can't find a way to create an event trigger with a presence-based predicate ideally for a particular user at home; or at least, for all users at home. Just for the record, the rationale: I need to keep the heating on in the user's private room when he is at home, off when he is not. The idea is to have a trigger based on a low temperature event (I can do that and works all right), which would then check whether the user is at home through the predicate; if so, it would open the radiator valve (the action also tested and also working all right); if not, it would do nothing. How to? Since I could find no API to create an HMPresenceEvent for a particular user, I've set it up in the Home application, and tried to use it this way (I happen to have only one such at the moment in Home, so there's no need to check the attributes): HMPresenceEvent *pevent; for (HMEventTrigger *t in home.triggers) if ([t isKindOfClass:HMEventTrigger.class]) for (HMPresenceEvent *e in t.events) if ([e isKindOfClass:HMPresenceEvent.class]) { pevent=[e copy]; break; } NSPredicate *p=[HMEventTrigger predicateForEvaluatingTriggerWithPresence:pevent]; HMEventTrigger *et=[[HMEventTrigger alloc] initWithName:@"TEST PRESENCE" events:... endEvents:nil recurrences:nil predicate:p];alas, this raises the “NSInvalidArgumentException: Invalid parameter; (user info absent)” exception. Looks like copy loses this information somehow?!? Without appropriate public APIs one can't say :( (Since I can set up these events in the Home application freely with any kinds of action, it seems to be patently absurd not to open these APIs for privacy reasons, but that's another question, not for this ticket.) Anyway, I've tried to resort to checking for “all users at home” through pevent=[[HMPresenceEvent alloc] initWithPresenceEventType:HMPresenceEventTypeAtHome presenceUserType:HMPresenceEventUserTypeHomeUsers];where HMPresenceEventUserTypeHomeUsers is documented as “Presence of all home users”. Nevertheless, when I log out the result, I get just “any user“: [Presence-Event: type: HMPresenceTypeAnyUserAtHome, mode: HMPresenceEventActivationGranularityHome]That's unusable for me. I need to check for presence of all users (if checking for a particular one is really forbidden for some inexplicable reason). Please help. How to properly set up a trigger predicate for (ideally) a given specific HMUser, or at the very least, for a presence of all registered home users. Thanks!
0
0
63
2d
Missing entitlement for API HomeKit error
During a test run of my HomeKit application in Xcode, after some time the app did run smoothly, I've started for one characteristic to get a pretty weird error in the readValueWithCompletionHandler: callback block: Error Domain=HMErrorDomain Code=80 "Missing entitlement for API." UserInfo={NSLocalizedFailureReason=Handler does not support background access, NSLocalizedDescription=Missing entitlement for API.} The application was launched just a couple of hours ago and the profile is still OK (though it will expire very inconveniently soon): 1044 ocs /tmp> security cms -D -i /Users/ocs/Library/Developer/Xcode/DerivedData/HomeObserverNA-hkazqlfbeuucvybpdzdgosyhhxnx/Build/Products/Debug-maccatalyst/HomeObserverNA.app/Contents/embedded.provisionprofile -o /tmp/ppp.plist 1045 ocs /tmp> plutil -extract ExpirationDate raw -o - /tmp/ppp.plist 2026-10-15T14:04:02Z 1046 ocs /tmp> Note please that immediately after launch (and for some time after that) the value was read in through the same code without any problem. Strangely enough, when I've switched the device through the Home application, I've got the update planned through enableNotification:completionHandler: all right. and the error stopped occurring, readValueWithCompletionHandler: from that moment on again works as presumed. How can I fix the problem, what's wrong in my app? Thanks!
18
0
882
4d
Weird HomeKit characteristic updates
My application essentially goes through all accessories in a home (with some filtering to select just some of them) goes through all services of an accessory goes through all characteristics of a service (with some filtering, dtto) If the acc is reachable, non-blocked, and if the characteristic has the SupportsEventNotification property, then (and only then) my controller is set as the accessory delegate the characteristic is sent the enableNotification:completionHandler: message my controller, of course, implements the accessory:service:didUpdateValueForCharacteristic: method. It works well most time, but I have bumped into two separate problems: (i) occasionally, although a device does change its characteristic all right in reality (typically triggered by an automation and observed personally), I do not get the appropriate accessory:service:didUpdateValueForCharacteristic: message at all. Is that normal? I sort of presume it would happen, if there's some communication glitch inside of the HomeKit ecosystem, right? The best way to alleviate this problem would be to set up a timer and e.g., once a minute poll all observed characteristics using readValueWithCompletionHandler:, and if the current value differs from the previously seen one, assume it did change and simulate the update internally, right? Or is there a better approach? (ii) what seems to me even more weird, occasionally I get the accessory:service:didUpdateValueForCharacteristic: message for a characteristic which I did not observe (it never was sent enableNotification:completionHandler:). The solution is of course trivial, I simply ignore these superfluous updates, but I wonder: is it sort of normal, or does that mean my application must have a bug somewhere? Thanks!
5
0
601
1w
Access to Matter “characteristic” in a HomeKit app?
Hi there, I am working on a (Mac Catalyst) HomeKit my own private application, which observes different characteristics of different accessories. This works (also thanks to the advice here, thanks again to all who helped!) like a charm. Now I've found that one of my outlets which is connected through Matter supports power consumption (in Home.app), but there is no characteristic for that, all I can see is its power state. Self-evidently, access to the consumption would be something Matter-specific. At this moment, to save time, I'd rather not study the complete Matter kit in detail if it can be dodged for this particular very limited goal. Is it possible just as simply as possible to read in (if readable) and observe (if observable) those extra Matter characteristics (if any) for an HMAccessory, presumably through its matterNodeID somehow? I'd be grateful for a sample code, if some is available (preferably ObjC, but of course Swift better'n nothing). Thanks a lot!
8
0
301
2w
MacOS HomeKit private (and still useable) application
How do I write a macOS (no need for i/Pad/OS at all) application which supports HomeKit for my own private use only? My original idea was simply to write it non-provisioned, which would solve all problems perfectly. Nevertheless, that, triple alas, seems not possible (https://developer.apple.com/forums/thread/849288). Provisioned one built locally has a lot of problems, among which there are e.g., big hurdles to run it at my other Macs (https://developer.apple.com/forums/thread/848903?answerId=907702022#907702022) an extremely limited expiration date A reasonable solution would be a creation of a provisioning profile which would include an expiration date in a far future and also IDs of my other computers; alas, far as I understand, this does not seem to be possible with a Personal Team, as detailed in https://developer.apple.com/forums/thread/848903?answerId=907568022#907568022. Whilst a sort of solution might be the nuclear one, it does not feel right the slightest — I need just to run my own app, nothing more, and whilst naturally I gladly accept all the possible dangers of code I wrote myself, I definitely would not want to get completely vulnerable where all the other apps (and other threats) in the world are concerned. I've checked also the Unlisted distribution; far as understand it properly, won't do either, e.g., since it will be declined ... if your app is in a beta or prerelease state — the application is fully intended to be used locally for months or even years in this state. Besides, even Unlisted apps must go through Review, and when I bump to a need to make any kind of change, I want simply do that locally and launch my new version immediately without any Review hassle. Also, in this case the otherwise important privacy issues like e.g., determining the proper computer name (https://developer.apple.com/forums/thread/813853?answerId=874075022#874075022) are of absolutely no importance. Are there other, more reasonable options? What's the proper solution, after all? Thanks!
3
0
363
3w
MacOS HomeKit non-provisioned application
How to write a macOS (no need for i/Pad/OS at all) application which supports HomeKit without provisioning? Might be a non-GUI plain tool or essentially anything runnable, if it makes the solution easier. All it ever needs is access to HomeKit (in future probably also Matter) APIs and the filesystem (to write logs). The application will be used locally and privately only. Thus, the provisioning is definitely not needed, and it brings ugly problems (compare please the thread https://developer.apple.com/forums/thread/848903). Thanks!
4
0
365
3w
readValueWithCompletionHandler: limitations?
Are there some undocumented (or, well, documented, but overlooked by me) prerequisites to the readValueWithCompletionHandler: method? The reason I ask is that occasionally I am getting the Read/Write operation failed error in the callback, even in cases where direct, non-deferred reading of the value worked properly. It seems to happen very consistently with some accessories and characteristics, not randomly; thus, it is not likely a temporary quirk in the communication with the device. Probably I am overlooking something of importance, but it does not make a good sense to me. My code (is it right, or can you see anything wrong in there?) // in an HMCharacteristic category if ([self.properties containsObject:HMCharacteristicPropertyReadable]) { id val=self.value, ident=[NSString stringWithFormat:@" [%@] %@ (%@)", self.uniqueIdentifier, self.localizedDescription, self.service.accessory.name]; NSLog(@"nondeferred '%@'%@", val, ident); if (self.service.accessory.reachable) { [self readValueWithCompletionHandler:^(NSError * _Nullable error) { if (error) NSLog(@"deferred ERROR %@ -> %@", ident, error); else NSLog(@"deferred '%@'%@", self.value, ident); }]; } } for most accessories/characteristics works properly, but for some of them I am consistently getting results like nondeferred '70.5' [64998F70-9C11-502F-B8B4-E99DC5C3171B] Current Relative Humidity (Vlhkoměr TH) deferred '70.5' ERROR [64998F70-9C11-502F-B8B4-E99DC5C3171B] Current Relative Humidity (Vlhkoměr TH) -> Error Domain=HMErrorDomain Code=74 "Read/Write operation failed." UserInfo={NSLocalizedDescription=Read/Write operation failed.} Do I do something wrong in my code, or is that normal with some devices? If the latter, is there perhaps a way to know beforehand that I should not use readValueWithCompletionHandler: (for it is bound to fail anyway), and instead I should simply use self.value non-deferred? For some time it seemed to me it happens with bridged accessories, but not really, this hypothesis proved wrong by further testing. Thanks!
3
0
925
Feb ’26
Catalyst: determine the device information when running on Mac
When I've tried to use UIDevice on my Mac running my Catalyst application, testing code UIDevice *d=UIDevice.currentDevice; for (NSString *k in @[@"name", @"systemName", @"systemVersion", @"model", @"localizedModel"]) NSLog(@"%@ -> %@", k, [d valueForKey:k]); to my great surprise I am getting name -> iPad systemName -> iPadOS systemVersion -> 26.3 model -> iPad localizedModel -> iPad What the. How do I determine the real values? Thanks!
11
0
1.6k
Feb ’26
hide/show scene in Home View API
Which HomeKit API serves for the Home application scene (HMActionSet)-related functionality “Remove from Home View” and “Add to Home View”? There must be a public API for that, for at the very least one 3rd party application shows/hides scenes appropriately as they are set up in Home; nevertheless, whatever I try, I can't find the API. Thanks!
2
0
810
Jan ’26
really modal alert in i(Pad)OS 18
I need a really modal alert, i.e., one which runs and allows the user interaction and closes and returns the selected option inside of a single method. (I need to serve an API which calls my callback, presuming I show an alert, get the user's decision, and return it from that very callback. The callback comes in the main thread.) What's the proper way to do this in i(Pad)OS 18+? Thanks! For reference, up to 17, the following code worked nicely; in 18, it does not anymore: volatile BOOL __block stillRuns=YES; UIAlertController* ac=[UIAlertController alertControllerWith... preferredStyle:UIAlertControllerStyleAlert]; [ac addAction:[UIAlertAction actionWith... handler:^(UIAlertAction * _Nonnull action) { stillRuns=NO; }]]; ... [UIApplication.sharedApplication.keyWindow.rootViewController presentViewController:ac animated:YES completion:nil]; while (stillRuns) [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:.1]];
Topic: UI Frameworks SubTopic: UIKit Tags:
4
0
750
Dec ’24
hidden menu sometimes does not show
We have a pair of co-operating applications. The standard one maintains the main menu; there's also a login item (installed through +[SMAppService loginItemServiceWithIdentifier:]), which has its own GUI. To the user, both are presented as one application: very often, a login item's window is active while the standard app's main menu is presented (since login items cannot own the menu bar). Normally it works all right. Nevertheless, when the main menu is hidden (System Settings / Control Center / Automatically hide and show the menu bar: Always), sometimes (intermittently) it does not show. We have ascertained that the setup is all right, i.e., the login item is the current app all right (by our own logs; also, NSWorkspace.sharedWorkspace.frontmostApplication of an independent application shows our login item) the standard application owns the menu (again, by our logs, and NSWorkspace.sharedWorkspace.menuBarOwningApplication of an independent code shows our standard app). Yet, when the user brings the pointer to the top of the screen, nothing happens. Notably, when menu is not hidden, the proper menu bar (of the standard application) is shown all the time. Does anybody know what to do to fix the problem?
5
0
568
Aug ’24
Cannot switch log level to off?
What do I miss here? root@MacBook-Pro /tmp # sw_vers ProductName: macOS ProductVersion: 13.6.1 BuildVersion: 22G313 root@MacBook-Pro /tmp # log config --mode "level: off" root@MacBook-Pro /tmp # log config --status System mode = INFO root@MacBook-Pro /tmp # log config --mode "level: debug" root@MacBook-Pro /tmp # log config --status System mode = DEBUG root@MacBook-Pro /tmp # log config --mode "level: off" root@MacBook-Pro /tmp # log config --status System mode = DEBUG
2
0
1.3k
Jan ’24
/usr/bin/log sometimes does not work through NSTask
Our application (which happens to run in an admin account, thus there's no problem authenticating) collects logs calling /usr/bin/log through NSTask. Usually this works all right, but sometimes all we get is the header Timestamp Thread Type Activity PID TTL and nothing else. The tool finishes with a zero result code, we get nothing on stderr and just the header above on stdout, with a proper EOF (as determined by a zero-length availableData read from an NSFileHandle through the stdout pipe). At the same moment, if the /usr/bin/log tool is run manually in a Terminal window with precisely the same arguments in the same user account the application runs in, we get the logs all right. Any idea what might be the culprit and how to fix the problem? Thanks!
0
0
910
Jan ’24
HMPresenceEvent-based predicate woes
I can't find a way to create an event trigger with a presence-based predicate ideally for a particular user at home; or at least, for all users at home. Just for the record, the rationale: I need to keep the heating on in the user's private room when he is at home, off when he is not. The idea is to have a trigger based on a low temperature event (I can do that and works all right), which would then check whether the user is at home through the predicate; if so, it would open the radiator valve (the action also tested and also working all right); if not, it would do nothing. How to? Since I could find no API to create an HMPresenceEvent for a particular user, I've set it up in the Home application, and tried to use it this way (I happen to have only one such at the moment in Home, so there's no need to check the attributes): HMPresenceEvent *pevent; for (HMEventTrigger *t in home.triggers) if ([t isKindOfClass:HMEventTrigger.class]) for (HMPresenceEvent *e in t.events) if ([e isKindOfClass:HMPresenceEvent.class]) { pevent=[e copy]; break; } NSPredicate *p=[HMEventTrigger predicateForEvaluatingTriggerWithPresence:pevent]; HMEventTrigger *et=[[HMEventTrigger alloc] initWithName:@"TEST PRESENCE" events:... endEvents:nil recurrences:nil predicate:p];alas, this raises the “NSInvalidArgumentException: Invalid parameter; (user info absent)” exception. Looks like copy loses this information somehow?!? Without appropriate public APIs one can't say :( (Since I can set up these events in the Home application freely with any kinds of action, it seems to be patently absurd not to open these APIs for privacy reasons, but that's another question, not for this ticket.) Anyway, I've tried to resort to checking for “all users at home” through pevent=[[HMPresenceEvent alloc] initWithPresenceEventType:HMPresenceEventTypeAtHome presenceUserType:HMPresenceEventUserTypeHomeUsers];where HMPresenceEventUserTypeHomeUsers is documented as “Presence of all home users”. Nevertheless, when I log out the result, I get just “any user“: [Presence-Event: type: HMPresenceTypeAnyUserAtHome, mode: HMPresenceEventActivationGranularityHome]That's unusable for me. I need to check for presence of all users (if checking for a particular one is really forbidden for some inexplicable reason). Please help. How to properly set up a trigger predicate for (ideally) a given specific HMUser, or at the very least, for a presence of all registered home users. Thanks!
Replies
0
Boosts
0
Views
63
Activity
2d
Missing entitlement for API HomeKit error
During a test run of my HomeKit application in Xcode, after some time the app did run smoothly, I've started for one characteristic to get a pretty weird error in the readValueWithCompletionHandler: callback block: Error Domain=HMErrorDomain Code=80 "Missing entitlement for API." UserInfo={NSLocalizedFailureReason=Handler does not support background access, NSLocalizedDescription=Missing entitlement for API.} The application was launched just a couple of hours ago and the profile is still OK (though it will expire very inconveniently soon): 1044 ocs /tmp> security cms -D -i /Users/ocs/Library/Developer/Xcode/DerivedData/HomeObserverNA-hkazqlfbeuucvybpdzdgosyhhxnx/Build/Products/Debug-maccatalyst/HomeObserverNA.app/Contents/embedded.provisionprofile -o /tmp/ppp.plist 1045 ocs /tmp> plutil -extract ExpirationDate raw -o - /tmp/ppp.plist 2026-10-15T14:04:02Z 1046 ocs /tmp> Note please that immediately after launch (and for some time after that) the value was read in through the same code without any problem. Strangely enough, when I've switched the device through the Home application, I've got the update planned through enableNotification:completionHandler: all right. and the error stopped occurring, readValueWithCompletionHandler: from that moment on again works as presumed. How can I fix the problem, what's wrong in my app? Thanks!
Replies
18
Boosts
0
Views
882
Activity
4d
Weird HomeKit characteristic updates
My application essentially goes through all accessories in a home (with some filtering to select just some of them) goes through all services of an accessory goes through all characteristics of a service (with some filtering, dtto) If the acc is reachable, non-blocked, and if the characteristic has the SupportsEventNotification property, then (and only then) my controller is set as the accessory delegate the characteristic is sent the enableNotification:completionHandler: message my controller, of course, implements the accessory:service:didUpdateValueForCharacteristic: method. It works well most time, but I have bumped into two separate problems: (i) occasionally, although a device does change its characteristic all right in reality (typically triggered by an automation and observed personally), I do not get the appropriate accessory:service:didUpdateValueForCharacteristic: message at all. Is that normal? I sort of presume it would happen, if there's some communication glitch inside of the HomeKit ecosystem, right? The best way to alleviate this problem would be to set up a timer and e.g., once a minute poll all observed characteristics using readValueWithCompletionHandler:, and if the current value differs from the previously seen one, assume it did change and simulate the update internally, right? Or is there a better approach? (ii) what seems to me even more weird, occasionally I get the accessory:service:didUpdateValueForCharacteristic: message for a characteristic which I did not observe (it never was sent enableNotification:completionHandler:). The solution is of course trivial, I simply ignore these superfluous updates, but I wonder: is it sort of normal, or does that mean my application must have a bug somewhere? Thanks!
Replies
5
Boosts
0
Views
601
Activity
1w
Access to Matter “characteristic” in a HomeKit app?
Hi there, I am working on a (Mac Catalyst) HomeKit my own private application, which observes different characteristics of different accessories. This works (also thanks to the advice here, thanks again to all who helped!) like a charm. Now I've found that one of my outlets which is connected through Matter supports power consumption (in Home.app), but there is no characteristic for that, all I can see is its power state. Self-evidently, access to the consumption would be something Matter-specific. At this moment, to save time, I'd rather not study the complete Matter kit in detail if it can be dodged for this particular very limited goal. Is it possible just as simply as possible to read in (if readable) and observe (if observable) those extra Matter characteristics (if any) for an HMAccessory, presumably through its matterNodeID somehow? I'd be grateful for a sample code, if some is available (preferably ObjC, but of course Swift better'n nothing). Thanks a lot!
Replies
8
Boosts
0
Views
301
Activity
2w
MacOS HomeKit private (and still useable) application
How do I write a macOS (no need for i/Pad/OS at all) application which supports HomeKit for my own private use only? My original idea was simply to write it non-provisioned, which would solve all problems perfectly. Nevertheless, that, triple alas, seems not possible (https://developer.apple.com/forums/thread/849288). Provisioned one built locally has a lot of problems, among which there are e.g., big hurdles to run it at my other Macs (https://developer.apple.com/forums/thread/848903?answerId=907702022#907702022) an extremely limited expiration date A reasonable solution would be a creation of a provisioning profile which would include an expiration date in a far future and also IDs of my other computers; alas, far as I understand, this does not seem to be possible with a Personal Team, as detailed in https://developer.apple.com/forums/thread/848903?answerId=907568022#907568022. Whilst a sort of solution might be the nuclear one, it does not feel right the slightest — I need just to run my own app, nothing more, and whilst naturally I gladly accept all the possible dangers of code I wrote myself, I definitely would not want to get completely vulnerable where all the other apps (and other threats) in the world are concerned. I've checked also the Unlisted distribution; far as understand it properly, won't do either, e.g., since it will be declined ... if your app is in a beta or prerelease state — the application is fully intended to be used locally for months or even years in this state. Besides, even Unlisted apps must go through Review, and when I bump to a need to make any kind of change, I want simply do that locally and launch my new version immediately without any Review hassle. Also, in this case the otherwise important privacy issues like e.g., determining the proper computer name (https://developer.apple.com/forums/thread/813853?answerId=874075022#874075022) are of absolutely no importance. Are there other, more reasonable options? What's the proper solution, after all? Thanks!
Replies
3
Boosts
0
Views
363
Activity
3w
MacOS HomeKit non-provisioned application
How to write a macOS (no need for i/Pad/OS at all) application which supports HomeKit without provisioning? Might be a non-GUI plain tool or essentially anything runnable, if it makes the solution easier. All it ever needs is access to HomeKit (in future probably also Matter) APIs and the filesystem (to write logs). The application will be used locally and privately only. Thus, the provisioning is definitely not needed, and it brings ugly problems (compare please the thread https://developer.apple.com/forums/thread/848903). Thanks!
Replies
4
Boosts
0
Views
365
Activity
3w
Cannot run Catalyst app on other devices?!?
I prepare a private project in Xcode, use Archive, Distribute/Copy, save the application somewhere. Copy it to my other computer, run. Works perfectly with normal MacOS applications. With Catalyst ones though it does not; whatever I try, all I get is “The application XXX cannot be opened”. What do I do wrong and how to fix the problem? Thanks!
Replies
8
Boosts
0
Views
494
Activity
4w
readValueWithCompletionHandler: limitations?
Are there some undocumented (or, well, documented, but overlooked by me) prerequisites to the readValueWithCompletionHandler: method? The reason I ask is that occasionally I am getting the Read/Write operation failed error in the callback, even in cases where direct, non-deferred reading of the value worked properly. It seems to happen very consistently with some accessories and characteristics, not randomly; thus, it is not likely a temporary quirk in the communication with the device. Probably I am overlooking something of importance, but it does not make a good sense to me. My code (is it right, or can you see anything wrong in there?) // in an HMCharacteristic category if ([self.properties containsObject:HMCharacteristicPropertyReadable]) { id val=self.value, ident=[NSString stringWithFormat:@" [%@] %@ (%@)", self.uniqueIdentifier, self.localizedDescription, self.service.accessory.name]; NSLog(@"nondeferred '%@'%@", val, ident); if (self.service.accessory.reachable) { [self readValueWithCompletionHandler:^(NSError * _Nullable error) { if (error) NSLog(@"deferred ERROR %@ -> %@", ident, error); else NSLog(@"deferred '%@'%@", self.value, ident); }]; } } for most accessories/characteristics works properly, but for some of them I am consistently getting results like nondeferred '70.5' [64998F70-9C11-502F-B8B4-E99DC5C3171B] Current Relative Humidity (Vlhkoměr TH) deferred '70.5' ERROR [64998F70-9C11-502F-B8B4-E99DC5C3171B] Current Relative Humidity (Vlhkoměr TH) -> Error Domain=HMErrorDomain Code=74 "Read/Write operation failed." UserInfo={NSLocalizedDescription=Read/Write operation failed.} Do I do something wrong in my code, or is that normal with some devices? If the latter, is there perhaps a way to know beforehand that I should not use readValueWithCompletionHandler: (for it is bound to fail anyway), and instead I should simply use self.value non-deferred? For some time it seemed to me it happens with bridged accessories, but not really, this hypothesis proved wrong by further testing. Thanks!
Replies
3
Boosts
0
Views
925
Activity
Feb ’26
Catalyst: determine the device information when running on Mac
When I've tried to use UIDevice on my Mac running my Catalyst application, testing code UIDevice *d=UIDevice.currentDevice; for (NSString *k in @[@"name", @"systemName", @"systemVersion", @"model", @"localizedModel"]) NSLog(@"%@ -> %@", k, [d valueForKey:k]); to my great surprise I am getting name -> iPad systemName -> iPadOS systemVersion -> 26.3 model -> iPad localizedModel -> iPad What the. How do I determine the real values? Thanks!
Replies
11
Boosts
0
Views
1.6k
Activity
Feb ’26
hide/show scene in Home View API
Which HomeKit API serves for the Home application scene (HMActionSet)-related functionality “Remove from Home View” and “Add to Home View”? There must be a public API for that, for at the very least one 3rd party application shows/hides scenes appropriately as they are set up in Home; nevertheless, whatever I try, I can't find the API. Thanks!
Replies
2
Boosts
0
Views
810
Activity
Jan ’26
really modal alert in i(Pad)OS 18
I need a really modal alert, i.e., one which runs and allows the user interaction and closes and returns the selected option inside of a single method. (I need to serve an API which calls my callback, presuming I show an alert, get the user's decision, and return it from that very callback. The callback comes in the main thread.) What's the proper way to do this in i(Pad)OS 18+? Thanks! For reference, up to 17, the following code worked nicely; in 18, it does not anymore: volatile BOOL __block stillRuns=YES; UIAlertController* ac=[UIAlertController alertControllerWith... preferredStyle:UIAlertControllerStyleAlert]; [ac addAction:[UIAlertAction actionWith... handler:^(UIAlertAction * _Nonnull action) { stillRuns=NO; }]]; ... [UIApplication.sharedApplication.keyWindow.rootViewController presentViewController:ac animated:YES completion:nil]; while (stillRuns) [NSRunLoop.currentRunLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:.1]];
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
4
Boosts
0
Views
750
Activity
Dec ’24
hidden menu sometimes does not show
We have a pair of co-operating applications. The standard one maintains the main menu; there's also a login item (installed through +[SMAppService loginItemServiceWithIdentifier:]), which has its own GUI. To the user, both are presented as one application: very often, a login item's window is active while the standard app's main menu is presented (since login items cannot own the menu bar). Normally it works all right. Nevertheless, when the main menu is hidden (System Settings / Control Center / Automatically hide and show the menu bar: Always), sometimes (intermittently) it does not show. We have ascertained that the setup is all right, i.e., the login item is the current app all right (by our own logs; also, NSWorkspace.sharedWorkspace.frontmostApplication of an independent application shows our login item) the standard application owns the menu (again, by our logs, and NSWorkspace.sharedWorkspace.menuBarOwningApplication of an independent code shows our standard app). Yet, when the user brings the pointer to the top of the screen, nothing happens. Notably, when menu is not hidden, the proper menu bar (of the standard application) is shown all the time. Does anybody know what to do to fix the problem?
Replies
5
Boosts
0
Views
568
Activity
Aug ’24
Cannot switch log level to off?
What do I miss here? root@MacBook-Pro /tmp # sw_vers ProductName: macOS ProductVersion: 13.6.1 BuildVersion: 22G313 root@MacBook-Pro /tmp # log config --mode "level: off" root@MacBook-Pro /tmp # log config --status System mode = INFO root@MacBook-Pro /tmp # log config --mode "level: debug" root@MacBook-Pro /tmp # log config --status System mode = DEBUG root@MacBook-Pro /tmp # log config --mode "level: off" root@MacBook-Pro /tmp # log config --status System mode = DEBUG
Replies
2
Boosts
0
Views
1.3k
Activity
Jan ’24
/usr/bin/log sometimes does not work through NSTask
Our application (which happens to run in an admin account, thus there's no problem authenticating) collects logs calling /usr/bin/log through NSTask. Usually this works all right, but sometimes all we get is the header Timestamp Thread Type Activity PID TTL and nothing else. The tool finishes with a zero result code, we get nothing on stderr and just the header above on stdout, with a proper EOF (as determined by a zero-length availableData read from an NSFileHandle through the stdout pipe). At the same moment, if the /usr/bin/log tool is run manually in a Terminal window with precisely the same arguments in the same user account the application runs in, we get the logs all right. Any idea what might be the culprit and how to fix the problem? Thanks!
Replies
0
Boosts
0
Views
910
Activity
Jan ’24