Questions tagged [objective-c]
This tag should be used only on questions that are about Objective-C features or depend on code in the language. The tags [cocoa] and [cocoa-touch] should be used to ask about Apple's frameworks or classes. Use the related tags [ios], [macos], [apple-watch] and [tvos] for issues specific to those platforms.
objective-c
292,225
questions
-1
votes
0
answers
4
views
How to have a performant pitch detection for iOS
I want to have a performant (so maybe c or c++) library to have a pitch detection on my iOS app.
I search a lot but no found at all.
Thanks all !
0
votes
0
answers
4
views
Problems in saving NSView with subviews to PDF
I have an NSView with NSImage instances as subviews that all show up correctly on the screen. I want to save them to a PDF file but the subviews are not included.
The routine works well and also saves ...
0
votes
0
answers
14
views
Unable to create framework in Xcode 15 with Objective-C throwing error "Command PhaseScriptExecution failed with a nonzero exit code"
I am trying to create objective C Network framework using Xcode 15 with minimum supported iOS version 14.0.
Here are the steps I am following:
I created New> Project> framework> Objective C&...
1
vote
1
answer
30
views
How can I mock an Objective-C class from Swift code for unit testing?
I'm trying to unit test a Swift class that depends on an Objective-C class. Call these SwiftClass and ObjcClass.
I created a protocol that contains the methods/properties of ObjcClass that SwiftClass ...
0
votes
0
answers
16
views
How to corroct get notification permission in Objc?
I have a way to get push permissions.
But what I get every time is not the correct value.
How can I rewrite this method?
My push permission has been enabled, but it still prints out 555 first and then ...
-1
votes
0
answers
24
views
How to call "AutoFill Password" dialog like click password button in iOS system keyboard?
I want call "AutoFill Password" dialog like click password button in iOS system keyboard. Is Any iOS API can do that?
I've try using ASAuthorizationPasswordRequest and ...
-1
votes
0
answers
15
views
kABPhoneProperty how to check the label?
I'm working in Obj-C and am using an ABPersonPicker.
I am able to obtain the phone number from the selected person and output the phone number of any given index. This all works great, however I need ...
-1
votes
0
answers
11
views
“'FIRMessaging' has different definitions in different modules; first difference is defined here found property”
I am currently upgrading an iOS project to version 7.1.0 by creating a new Cordova project. After integrating the 'NativeLogs' plugin, the build process in Xcode fails with multiple errors, one of ...
0
votes
0
answers
23
views
setValidatesSecureCertificate:NO causing error
I am working on old project and something weird is happening.
Below is the code we have.
-(void)startRequest{
if (![NetworkConnect connectedToInternet]) {
[self onError];
return;
...
0
votes
1
answer
27
views
Exclusion of a directory from backup : NSURLIsExcludedFromBackupKey does not always stick even though setResourceValue has reported success
I want to exclude a directory in documents storage class from backup.
Setting exclusion attribute like so
+ (BOOL)kit_addSkipBackupAttributeForItemAtURL:(NSURL *)url
{
if (![[NSFileManager ...
-2
votes
0
answers
15
views
make a NSWindow of another app show and focused by clicking a foreground app's button in OC
I have an application H.app (the client app), it has two button a and b, By clicking these buttons, IPC send message to the server app(Also H.app), which will show window A or B. Here' s my sample ...
-1
votes
0
answers
28
views
Which way is preferred for a AND/OR logic? [closed]
I'm refactoring an old Objective-C project. There is 1 AND/OR logic condition that we are debating about:
NSString *str1 = [[url1.path lastPathComponent] stringByDeletingPathExtension];
NSString *str2 ...
0
votes
1
answer
52
views
Retrieve an audio file such as an mp3 from the documents directory in Objective-C or Swift
I would like to store and retrieve audio files such as MP3s in the user's documents directory. When I do this with images I can simply fetch the file as a UIImage. However, I'm struggling with what ...
0
votes
1
answer
53
views
Undo manager with multiple fields
Hello I have an application, it's very basic but has some fields for an address, so city, zip code, state etc...
I want it so the user can undo the content across multiple fields, currently the ...
0
votes
1
answer
36
views
AutoFill password into UITextField
I want to implement such a function: a password UITextField, using the system Jiugongge numeric keypad(textField.keyboardType = .numberPad), and enable to automatically fill the password. like this:
...
1
vote
1
answer
20
views
CGContextDrawImage: invalid context 0x0. Failed to bind EAGLDrawable to GL_RENDERBUFFER 2
I'm working on a custom UIView subclass in my iOS project that involves using GLKView and CAEAGLLayer for camera rendering and applying beauty filters. The main goal is to capture video from the ...
0
votes
0
answers
17
views
Cocoapod integration Issue in Framework as target
I have created an Application in which we have framework as target. I am using SendbirdChatSDK and Sendbirdcalls Cocoapod as dependency for framework.
While compiling it is showing error in swift ...
-1
votes
0
answers
38
views
Is there a way to force an NSObject to be allocated in stack or static memory?
I am asking this out of curiosity, because even if this can technically be done, this is almost certainly unsupported by Apple.
As far as I can tell, only NSString literals, and possibly NSDictionary ...
0
votes
0
answers
29
views
Can we customize how parameters and return types are imported from Objective-C into Swift?
I have an Objective-C class that is a proxy to an NSDictionary.
@interface DictionaryProxy : NSProxy
-(id)objectForKey:(id)key;
-(void)setObject:(id)obj forKey:(id<NSCopying>)key;
@end
I have ...
-1
votes
0
answers
55
views
SwiftUI Scroller flashing entire collection when inserting new data
I Have a SwiftUI view which is a collection that displays each item on a full screen sized view. While the user is viewing and interacting with the items (it's a view that shows photo or video that ...
1
vote
0
answers
36
views
Unable to mount NFS share using mount(2) on macOS
I've been trying to write an application for older versions of Mac OS X that mounts an NFS network share and ran into an interesting quirk when trying to use the mount(2) function. According to the ...
0
votes
0
answers
49
views
Generating a signature for promotional offers in Objective-c
My requirements are to generate a signature for a promotional offer in the iOS app code (Objective-C), but I'm getting nil every time with the error: 'The operation couldn’t be completed. (OSStatus ...
0
votes
0
answers
38
views
How can I initiate a new URL request using an already loaded WKWebView?
I have opened a WKWebView with "https://www.google.com", for example. After that, I put my app in the background. When I try to open a new URL request in the same web view with a new link, ...
1
vote
0
answers
35
views
Broken `static_cast` from `NSURL*` to `CFURLRef`
Consider the code at the bottom. I am convinced it’s broken and should not compile. Line 224 has a static_cast from NSURL* to CFURLRef with no bridging which I believe will break the reference count. ...
0
votes
0
answers
33
views
Build input file cannot be found and xcode is searching file at wrong path after pod install
i am getting this error after pod install in xcode
error: Build input file cannot be found: '/usr/lib/libstdc++.6.0.9.dylib'. Did you forget to declare this file as an output of a script phase or ...
0
votes
0
answers
15
views
microsoft.identitymode.tokens.audienceurivalidationfailedexception was thrown while trying to open One Drive document in WKWebView in iOS app
I am working in iOS app needs to be opened One Drive attachments in WKWebView.
Sample One Drive document is
https://\*\*\*.sharepoint.com/personal/\*\*\*\*\*\_onmicrosoft_com/\_layouts/15/Doc.aspx?...
-1
votes
0
answers
25
views
Fetching data while UITableView Scroll
I have caught up in specific situations and cannot find a proper solution.
I have historic data and details are getting fetched via API1 and details are displayed in TableView
e.x
Name - Phone No
...
0
votes
0
answers
33
views
Issue with nullability specifiers in Xcode when developing Flutter app
I'm developing a Flutter application and encountering an issue with nullability specifiers in Xcode. Specifically, I have methods in my Objective-C files where Xcode is reporting conflicts with ...
0
votes
0
answers
40
views
How do I replace detail view controller navigation stack when presenting
I'm working with a UISplitViewController that's using some storyboards but now moving to programmatic presentation (which is what I'm familiar with). I have a VC that's currently presenting as a push, ...
0
votes
1
answer
42
views
Calling NSApplication from Rust using objc
I am trying to learn by doing a project of allowing AppKit certain functions , related with App and Window creation to be called from Rust using objc.
extern crate objc;
use objc::runtime::{Class,...
0
votes
0
answers
52
views
SQLCipher "file is not a database" Error After Updating iOS App
I'm encountering an issue with SQLCipher in my iOS app after updating to a new version, which involves different workspaces of my app. The app uses SQLCipher(version: 3.1) to manage an encrypted ...
0
votes
1
answer
27
views
Kotlin Multiplatform objective-c export file name convention
What logic is used to create class and protocol names when Kotlin code is exported to Objective-C? Additionally, where can I find detailed information about this process?
Where code like:
package ...
0
votes
0
answers
40
views
CMake sets “Generate Debug Symbols” - a Xcode build setting to wrong value
I’m trying to generate Xcode project file of some libraries with CMake.
I want to generate dSYM file in all build config type.
I set values in all my CMakelists.txt as below:
set(CMAKE_CXX_FLAGS &...
0
votes
0
answers
45
views
The request signature we calculated does not match the signature you provided. Check your key and signing method in objective-c in iOS , Xcode 15
We are using AWS-IOS-SDK to upload images and text.
error occurred in Xcode 15 but working good in Xcode 14 ,we used the same source code for both versions.
Please check the error message
AWSiOSSDKv2 [...
-1
votes
0
answers
21
views
Not able to add xpath in Forms Mode
We are unable to add xpath for TTD Desktop application for Mac in Forms Mode. There entire UI View is considered as a single screen(identifier). We are trying to capture xpath for each element in the ...
0
votes
0
answers
20
views
How to Reactivate the Last Focused Window After My Qt App Closes on macOS
I'm developing a screenshot-taker application using Qt and need some assistance with macOS-specific behavior.
Here’s the scenario:
When I take a screenshot, my application becomes focused to allow ...
-1
votes
0
answers
65
views
How to delete files thoroughly in iOS
I try to delete big file(1GB+) in the document directory of my developing App, the codes as below. When I deleted the file, but the space occupied by the app in iPhone storage has not changed. Does ...
0
votes
1
answer
27
views
Override NSManagedObject getter/setter to modify data
I have an NSManagedObject class that stores, among other things, a JSON string that comes from a WkWebView form. The form in the web view allows the user to add images to the form; when the form is ...
-1
votes
0
answers
32
views
macOS App Sandbox - access to ~/Documents folder [duplicate]
I have existing macOS application
the application is distributed via pkg
now I need Mac App Store version
I store application data in ~/Documents/MyApp
ideally i wan't to keep using same folder
1. ...
0
votes
0
answers
17
views
Getting unnecessary log while adding NotificationService Extension in IOS
I am using react native for an app.Just added NotificationService Extension for rich notifications and trying building my project
Getting these unnecessary log in console when hit to run on simulator.
...
0
votes
0
answers
54
views
Location manager delegate never called
I'm trying to build a simple macOS command-line tool in Objective C that merely gets the current location via a CLLocationManager. However, none of my delegate's methods are ever called and my ...
1
vote
0
answers
36
views
Reference variable in Store.swift class from Objective-C file using singleton pattern giving Linker command failed error
I am trying to reference a variable in a Swift class from an Objective-C view controller.
I can reference functions and variables in other Swift Classes from this Objective-C class. However, when I ...
0
votes
1
answer
49
views
Difference between String in Swift and NSString in Foundation(Objective C)
What is the actual difference between String in Swift and NSString in Foundation(Objective C).
I have seen all functions of NSString can be applied to String in swift. For example ...
0
votes
0
answers
71
views
Undeclared identifier 'nullptr' and Obj-C error while using Obj-C library in Swift
No prior knowledge for using external library in Swift.
I was trying to include sf-proj-ios in my empty project named "Test". I followed instruction on the library GitHub, used commands on ...
0
votes
0
answers
26
views
sharing pdf to my ios react native app from gallery/files issue
Recently I implemented ShareExtension in my ios app built using react-native.
coming straight to the point.
added below code to info.plist of ShareExtension app to support sharing of any kind of file/...
0
votes
0
answers
21
views
How can I update running(activated) system extension in mac?
Now we are trying to update our security solution. The solution is built with endpoint security extension, and it's already distributed for all clients, and we want to update them.
But it seems like ...
1
vote
1
answer
65
views
Xcode 15.4 always popup to click "Trust and Open" when open workspace
I just upgrade my macOS from Monterey to Sonoma. And then I also downloaded and installed the new XCode version 15.4. I'm also git clone my project from my BitBucket repo after upgraded to macOS ...
0
votes
1
answer
49
views
NSNumber array containsObject fails as types are different but they should be the same
I'm having troubles checking if an array contains an object.
The @property(nonatomic) NSArray<NSNumber*>* apiArray; array is returned as a parameter from an API model while the object of which I ...
0
votes
1
answer
53
views
I was trying to update the height constraint of my view during an animation. Its not getting updated why..?
Here is how i have configured the profile view,
-(void)addProfileView
{
if(!_profileView)
{
_profileView = [ProfileView new];
_profileView.clipsToBounds = YES;
...
0
votes
0
answers
32
views
How to check what data is received by APNS sent from backend?
I am working as iOS developer and now working to handle the Apple Push Notification Payload contains custom tag like this:
{
"aps": {
"alert": {
"title": "...