141 questions from the last 365 days
5
votes
1
answer
237
views
Usage of C++ reference to a struct in Swift methods
I've got codebase for iOS target with mixed languages in play: C++, Objective-C++ / Objective-C & now I want to start migration of Objective-C/Objective-C++ code to Swift.
Particular problem I'm ...
4
votes
1
answer
71
views
How to get PID from AudioObjectID on macOS pre Sonoma
I am working on an application to get when audio device is being used.
This app runs on macOS.
For Mac versions starting from Sonoma I can use this code:
int getAudioProcessPID(AudioObjectID process)
...
3
votes
1
answer
79
views
How to draw tinted monochrome SF Symbol with AppKit
This is super easy with UIKit (imageWithTintColor:) but I need tinted monochrome NSImage in AppKit and no such equivalent exists. I know there is private method in AppKit -[NSImage ...
2
votes
1
answer
120
views
Objective-C id as void* C++ class member
I'm writing a rendering device interface for a game engine and I'm currently in the process of figuring out how to implement a Metal backend. My RHI is built around an abstract class RHIDevice, whom ...
2
votes
0
answers
90
views
How to get call statistics for a pjsip call in iOS
I am working on an iOS project that uses the PJSIP library for video and audio calls.
I have an Objective-C wrapper that accesses the PJSIP C functions directly.
Now, I want to get statistics for each ...
2
votes
0
answers
450
views
React Native iOS Crash: setSheetLargestUndimmedDetent: on RCTView with Core <Modal> (RN 0.79, Fabric) - Started After Updates
I'm facing a persistent native crash on iOS (iOS 17+, simulator and device) when using the standard React Native component. This issue began after I recently updated Xcode, React, and React Native to ...
1
vote
1
answer
89
views
Swift 6 Strict Concurrency accessing C shared instance
I am trying to adapt C code, measuring pre/after main time, so it could be accessed from Swift with SC on. But nothing can silent compiler warning, indicating this code is not safe. I've tried every ...
1
vote
1
answer
109
views
Check if shift/cmd/option/caps-lock key is pressed in iOS app
I'm making an iOS application which can use hardware keyboard or run on Apple-Silicon macs. It seems that macos apps can take use of a very convenient APIs for checking if some of the modifier keys ...
1
vote
1
answer
64
views
UIDocumentPickerDelegate method(didPickDocumentsAt) not called on a real device; but it works fine on the simulator
I'm trying to use UIDocumentPickerViewController. It works fine on the simulator and also on a real device in debug mode.
I've tried replacing didPickDocumentAtURL with didPickDocumentsAtURLs but it ...
1
vote
1
answer
583
views
Mac AppStore local receipt validation using StoreKit AppTransaction from Swift - async problems
EDIT: changed this question into an answer, for those needing a solution for old Objective-C apps.
Soon Apple will change the receipts for mac Apps to SHA-256 encoding, so if you like me still use SHA-...
1
vote
1
answer
61
views
Cocoa - Block implicitly retains 'self' - Different solutions
So I have this snippet here which involves a block:
NSArray<Class> *acceptableClasses = @[[DesktopEntity class]];
__block NSInteger insertIdx = row;
[info ...
1
vote
0
answers
34
views
MKReverseGeocodingRequest fails with NSURLErrorDomain Code=-1009 (WatchOS 26)
We try to replace the depreated reverseGeocodeLocation call by MKReverseGeocodingRequest for WatchOS 26. However, the call always returns error -1009 indicating that there is no connection to the ...
1
vote
1
answer
96
views
How to draw line number with NSRulerView?
How to draw line number with NSRulerView?
Displaying line numbers with NSTextView, written with Objective-C, clean and simple. Sorry, I know this is an old question frequently asked, but I can't find ...
1
vote
1
answer
93
views
Alternative to sizeToFit to space items on toolbar assigned to keyboard inputAccessoryView?
I have created a toolbar and attached it as an inputAccessoryView to the keyboard following Paul Hudson's snippet here.
This is a legacy project with some Objective-C and I have converted Paul's code ...
1
vote
1
answer
70
views
CAMetalLayer nextDrawable Method is Unbearably Slow in MacOS Metal
The following code renders a scene: (It's called from within an @autorelease nesting)
- (void)setupEncoder:(nonnull MTKView *)view {
id<MTLCommandBuffer> commandBuffer = nil;
id<...
1
vote
1
answer
110
views
Failed to preview widget with CHSErrorDomain (1300):NSDebugDescription: extensionNotFound
When I added the widget extension to a multi-target project, the widget preview failed with an error saying Cannot preview in this file.
As we all know, the widget was introduced in iOS 14.0, but my ...
1
vote
0
answers
42
views
crash type:UIViewControllerHierarchyInconsistency,child view controller should have parent view controller:<ca00> but requested parent is:<1600>
When transitioning from full screen to half screen on an iPad 9G, add and remove views in the method:
- (void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
...
1
vote
1
answer
270
views
One way Audio issues in iOS 18.2 on call apps
I have a mobile app that uses for taking voice calls between two parties via VoIP protocol. That was worked until iOS 16 and now it is giving one way audio issues. That means when I try to take a call ...
1
vote
0
answers
103
views
Skia memory issues when used from static library on iOS
I've compiled Skia for iOS:
bin/gn gen out/ios-apple --args='target_os="ios" target_cpu="arm64" ios_use_simulator=false skia_enable_tools=false is_official_build=false is_debug=...
1
vote
0
answers
32
views
Can the Rust compiled node extension listen for notification events on the Mac system?
I want to implement an addon using Rust to expose an addListener API. When I modify the system's time zone, I can receive a callback.
using core_foundation_sys and neon
The code is as follows:
extern &...
1
vote
0
answers
31
views
NSTableView doesn't move row down when using NSTableViewDraggingDestinationFeedbackStyleGap
I have several NSTableView instances whose draggingDestinationFeedbackStyle is set to NSTableViewDraggingDestinationFeedbackStyleGap.
The delegate method tableView:validateDrop:proposedRow:...
0
votes
1
answer
60
views
How to animate an UIView by setting its frame that has auto layout constraints?
I have a UIView subclass called MyView as such
@implementation MyView
{
UIView<SomeImageProtocol> *_imageView;
}
- (instancetype) init
{
if (self = super) {
_imageView = ...
[self ...
0
votes
1
answer
77
views
How to Dynamically Load Images from a Nested Folder in the App Bundle (Swift / iOS) [duplicate]
I hope you're all doing great!
I'm working on an iOS app where I need to load a set of images that I've added manually to the app's resource bundle. The images are stored inside a known top-level ...
0
votes
1
answer
140
views
How do I monitor the fitting width change of an UIDatePicker on iOS using UIKit?
I'd like to monitor the fitting width of an UIDatePicker set to the mode of .date on iOS. By fitting width, I mean that usually obtained by systemLayoutSizeFittingSize(CGSize(0, 0)) -- but I need to ...
0
votes
1
answer
34
views
How do I get a click reported in WKWebView? [closed]
I'm late, I know. But now I have to update an old app in objective c and replace UIWebView with WKWebView. That's largely done and works fine – with one exception:
I have to react to clicked links. ...