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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
29 views

How to open finder inside WKWebView in macOS app?

In macOS, our requirement is to open a Finder when clicking Upload File from a web view. It works when I opened the same URL link in Safari but inside macOS application Open Finder its not getting ...
sanjay's user avatar
  • 11
0 votes
1 answer
34 views

How can I store automatic reference counted Swift/Objective-C objects in a C++ map without causing memory leaks when they are deleted from the map?

I have a C++ map which manages loaded regions. Each region has an associated MTLBuffer for the geometry generated after the region data is converted into a mesh. The idea is to store a reference to ...
user16217248's user avatar
  • 3,230
-1 votes
0 answers
46 views

iOS - How to disable focus in the UIDatePicker component for a touch event?

I have a UIDatePicker with a Wheel style which shows the date components. I have disable showing keyboard while touching on any component following this suggestion: [picker addTarget:self action:@...
Sazzad Hissain Khan's user avatar
0 votes
0 answers
33 views

Assign double variable to mutable array

I can't figure out why variable number is not being assigned to array self.items. In the debugger it is showing value of NULL. -(void)pushItem:(double)number{ [self.items addObject:[[NSNumber ...
Richard Noble's user avatar
-1 votes
0 answers
21 views

How can I apply effects to the computer audio(say any audio playing from YouTube) using AVAudioEngine [closed]

Can anyone tell how can I get computer audio and apply effects on the audio and play using AVAudioEngine? How to pass the system wide audio to the engine. Everywhere I can find the example where it ...
Babitha shetty k's user avatar
-2 votes
0 answers
68 views

iOS SHA1 Crashes in big data output [closed]

When I tried to chunk down big data using SHA1 in iOS, it gave me an error Thread 2: EXC_BAD_ACCESS (code=1, address=0x0) but when I try to chunk it down in a simulator, it doesnt give me any errors! ...
Jaaziel iSpoofer's user avatar
0 votes
1 answer
40 views

Pan Gesture is not recognized for the view while it is being transformed with scale animation? Why this is happening?

[self.currentView addGestureRecognizer:self.pangr]; // added somewhere above in the code [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ self....
DST's user avatar
  • 3
-1 votes
0 answers
20 views

How to Parse NSString of JSON Object having NSLocalizedDescription as one of the Key?

"error" : "{\n NSLocalizedDescription = "expired access/refresh token";\n error = "invalid_grant";\n}" I want to parse the value of ...
adijazz91's user avatar
  • 402
0 votes
0 answers
13 views

iOS SDK Objective-C Audio Route Change

I'm trying to simply set my audio to the iPhone earpiece. No success, this seems like it would work. Using iOS 17 on an iPhone 15 Pro. It doesn't throw any errors. Any advice appreciated. @...
Bill Kervaski's user avatar
0 votes
0 answers
25 views

Array multiplication in Objective-C, for NSArray and NSMutableArray

In Python, the expression 2*[a,b,c] (with a,b,c variables) is meaningful, and returns [a,b,c,a,b,c]. Also, in Python, lists (or arrays) are mutable by design. It is easy enough to write a category on ...
user22351903's user avatar
-3 votes
0 answers
21 views

Is there any Objective-C code for "Displaying an updating path of a user’s location history"? [closed]

There is a sample code (with Swift) from Apple like below. https://developer.apple.com/documentation/mapkit/mapkit_for_appkit_and_uikit/mapkit_overlays/...
doctor's user avatar
  • 101
-1 votes
0 answers
25 views

Detect content and crop the main feature in OpenCV using Objective-C + Using Obj-C function in SwiftUI

I'm working on an iOS app using SwiftUI, and I'm trying to use OpenCV in Objective-C to clean the background and crop the main feature of an image. I have a function that's supposed to do this, but it'...
Rin Star 's user avatar
0 votes
0 answers
23 views

how do I rotate a view in iOS objectiv-c?

I'm working on an old objective-c project. I have a requirement to run one of the views in landscape mode. The view is presented (not sure if this is relevant jut to let you know). I have: the ...
geanni Barbulescu's user avatar
-1 votes
1 answer
47 views

Cocoapods (AFNetworking) issue when archiving project

I am trying to build a legacy Obj-C project, it's getting around 80% of progress and fails with the following error. I tried to reinstall pods, clean Derived Data, restart Xcode/computer. `mkdir -p /...
Guard P's user avatar
0 votes
1 answer
21 views

How to update local sqlite data from custom data of Push notification payload when application is in Killed state or in background state

In my project Pushy used to handle Push notification. I want to update my local Sqlite data when I got a specific type of Push Notification. I am able to handle this when application is in foreground. ...
Kumar Lav's user avatar
  • 264
-1 votes
0 answers
38 views

How to clean handwritten text from background using OpenCV in SwiftUI with Objective-C integration? [closed]

I'm working on a project in Xcode using SwiftUI and I'm trying to clean handwritten text from a background (aka making it transparent) image using OpenCV. I'm trying to achieve a result like this: I'...
Rin Star 's user avatar
-1 votes
0 answers
31 views

downloading from sockets stops when moving to background

iOS version: 16.5 Language: C and Objective-C In our application, we have implemented functionality to get download speed using sockets. We open couple of threads to download file from server. We get ...
Kouv's user avatar
  • 1
-2 votes
0 answers
32 views

Getting error on target parameter trying to setup NSTimer

What's going on then? Is this possible in Objective-C? unexpected interface name 'HttpHelper': expected expression Code: NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:6 ...
kakay rivera's user avatar
0 votes
1 answer
23 views

Objective C: no known instance method for selector

Trying to call another static method in a file of static methods, although I get: Tweak.xm:324:11: error: no known instance method for selector 'test' static void rddhandler(id self2, SEL _cmd){ [...
kakay rivera's user avatar
1 vote
0 answers
15 views

WKWebView snapshot not working after certain size

I am using WKWebView in objective c to load my html string that i wrote for my project. it actually worked and i managed to save the image in my image path BUT it didnt work if the height exceeds 4100....
cloud's user avatar
  • 11
-2 votes
0 answers
18 views

NSMutableOrderedSet count is not updating though item is removed - coupled with UITableView

Got error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 1. The number of rows contained in an existing ...
Rao's user avatar
  • 47
0 votes
1 answer
30 views

How do I use NSISO8601DateFormatter to parse a date from a string in iOS?

For the life of me I can't understand why dateFromString is producing a nil value in the code below. NSString* timeStampValue = @"20230917120009.289Z"; NSString* dateString = [...
Blaire Crits-Christoph's user avatar
-3 votes
0 answers
34 views

Adding a Swift package to an old Objective-C project (bridging header)

I have added a Swift Package to my Objective-C project. As expected with the worst IDE ever created, Xcode, the classes in the Swift package can be accessed through the Objective-C project. Also, as ...
Duck's user avatar
  • 34.9k
0 votes
1 answer
58 views

What is Swift alternative to NSRange.location and NSRange.length?

I am trying the find some alternative to NSRange.location and NSRange.length in Swift. I have a string for example sip:[email protected] I am trying to extract name from it. I can do it using ...
Sagar D's user avatar
  • 223
0 votes
0 answers
14 views

add apple watch app into existing project emits error

I have objc + swift mixed project with using cocoapods. I already have bridge-header file. after i add watch app target which is companion with my app. all of my builds are failing with same message. ...
heesung kang's user avatar
0 votes
0 answers
33 views

How to I set custom height of model in share extension ios

Am new bee in iOS. I able to load SwiftUI into share extension using UIHostingController. I want to set custom height of the model. Currently it's taking full height. My code is class ...
sanjaylabs's user avatar
0 votes
1 answer
48 views

Objective-c Macro Language detection

I want a macro with the language in in. Currently the code is: #define APP_LOCALE_X @([[[NSLocale preferredLanguages] objectAtIndex:0] isEqualToString:@"nl_NL"]); #ifdef APP_LOCALE_X #...
Benjamin de Bos's user avatar
0 votes
0 answers
193 views

iOS 17 , when entering Chinese characters, the program crashes. The system is using UIWebView

iOS 17 , when entering Chinese characters, the program crashes. The system is using UIWebView. This is my error message. enter image description here. I know that Apple recommends replacing UIWebView ...
armin's user avatar
  • 1
1 vote
2 answers
42 views

Assigning to a pointer causes EXC_BAD_ACCESS through class_addMethod

I have an internal class that adoptsUIScrollViewDelegate, but does not implement scrollViewWillEndDragging(_:withVelocity:targetContentOffset:). I want to add this method to the class using ...
Balázs Vincze's user avatar
0 votes
1 answer
22 views

Programmatically fill one tableview, use IB bindings to fill others

A window is created in a xib, and it contains two tableviews, A and B. In interface builder, both A and B have the File's owner set as the delegate, since both will use some delegate methods, e.g. for ...
user22351903's user avatar
-1 votes
0 answers
20 views

How to check cmd + F2 key press in objective c

I need to handle a event for cmd+ f2 key event press. The below code is not reading the event NSEvent* (^handler)(NSEvent*) = ^(NSEvent *theEvent) { NSEvent *result = theEvent; ...
Shweta Mittal's user avatar
0 votes
0 answers
22 views

F2 key press event on macOS

Why kVK_F2 is not equivalent to constant NSF2FunctionKey for F2 key press event, What is equivalent constant of kVK_F2, since carbon framework is deprecated. When I printed the keyCode, The [Event ...
Shweta Mittal's user avatar
0 votes
1 answer
21 views

How to combine the color channels and alpha channel from two CIImage?

I have a CIImage from YUV data without alpha plane, and a gray scaled CIImage. I want to use the second image as the alpha plane. Currently, gpt tells me to use CISourceOverCompositing filter, but it ...
liaohy's user avatar
  • 55
1 vote
1 answer
21 views

Objective-C class properties not viewable on Swift playground

Question about Objective-C and Swift interoperability. I have some Objective-C headers and implementation files which I am using in a Swift playground for a bridging project. However the Playground ...
cauluCoda's user avatar
0 votes
1 answer
13 views

How to make a window level active when opening a utility panel

My app consists of several windows that all exist at the NSNormalWindowLevel. I recently added a new window that opens as a utility panel (and, hence, NSFloatingWindowLevel). This utility panel ...
johnpurlia's user avatar
0 votes
0 answers
25 views

Tab bar does not appear in iOS

I am trying to make an iOS hybrid app, but I'm stuck on the first step; my app does not show its tab bar like this pic tab bar not show My debug result shows in UITabBarController the self.tabBar....
hux1ao's user avatar
  • 1
0 votes
0 answers
9 views

How to set CLANG_ENABLE_MODULES for one CocoaPod?

I'm using an external CocoaPod. To avoid build issues I need to set CLANG_ENABLE_MODULES to YES. I know how to do this by changing the .podspec file: adding a setting to s.pod_target_xcconfig. Is ...
meaning-matters's user avatar
0 votes
0 answers
21 views

Crash app on video call using PJSIP in ios

When I am using pod 'pjsip','2.8.0' then the video call is working fine on My Mac(Designed for iPhone) but when I am trying to make a video call on a real iPhone device crash the app. libsp.dylib`...
Saurabh Pathak's user avatar
0 votes
0 answers
24 views

How to integrate Live Activity into Objective C projects?

I have a food delivery app similar to Uber Eat it was developed in Objective C now the requirement is to implement the Live activity for tracking the Active orders. As i tried Live activity over the ...
Malik Soban's user avatar
0 votes
0 answers
32 views

How to perform artifact-free fast drawing from bitmap data in Cocoa / Objective-C?

Disclaimer: I am mostly experienced with Gtk and FLTK on Linux and Windows. I am pretty much starting my macOS / Cocoa / Objective-C development journey. While I have done much research, I am not ...
Will B's user avatar
  • 155
0 votes
0 answers
29 views

ios webrtc virtual background and filter

i want to change the videosource from the rtccameravideocapture to remove background or add filter. and the method i do is to change the initwithdelegate to the class i create called ...
Peter Li's user avatar
2 votes
1 answer
52 views

OBJC @selector doesnt work from another implementation

int alert() { //Alerting UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"0%" message:nil preferredStyle:UIAlertControllerStyleAlert]; UIView *customView ...
Jack's user avatar
  • 245
0 votes
0 answers
36 views

Kotlin MPP: iOS Memory overload when using Kotlin defined function

I’m creating a kotlin multiplatform application that runs on web, iOS and Android that will process images captured from the device’s video stream. The processing works fine on Android and web, but ...
Callen's user avatar
  • 1
-1 votes
0 answers
32 views

Can't load Obj mtl with Assimp in iOS

I am trying to load obj file . const aiScene* scene = importer.ReadFile(inputFilePath.c_str(), aiProcess_ValidateDataStructure); if (!scene) { // Import failed std::cout<<...
Vivek's user avatar
  • 70
0 votes
0 answers
40 views

I want to remove the red button with the minus and make it so that the delete button shows up on swiping left now swiping isn't working

This is my code, I want to remove the red button with the minus and make it so that the delete button shows up on swiping left, now swiping isn't working. I checked UITableViewCellEditingStyleDelete ...
akshayTejus's user avatar
0 votes
0 answers
33 views

CoreData crash NSTaggedDate objectForKey

I'm using CoreData in my iOS application, I have a function that creates NSManagedObjectContext per thread: var contextDict = [Thread:NSManagedObjectContext]() var context:NSManagedObjectContext{ ...
YosiFZ's user avatar
  • 7,812
0 votes
0 answers
18 views

Can I get a localized language name for a locale code in Cocoa? [duplicate]

The [NSSpellChecker availableLanguages] method returns an array of locale codes (like "de", "en_GB" etc.). Is there a way that I can get localized language names (eg. "Deutsch&...
fbitterlich's user avatar
-1 votes
0 answers
81 views

Open files with objective C on iOS17 new file system?

I'm trying to open a file that is being given to my app after a user chose to open a file with my app in my appDelegate - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(...
Kargol's user avatar
  • 111
0 votes
0 answers
25 views

Display video call using PJSIP and SwiftUI in iOS

I am trying to render video using PJSIP but the video is not coming on video call. The audio call is working properly. On the click video call button, the Video opens above the Dial view. As for now, ...
Saurabh Pathak's user avatar
0 votes
0 answers
61 views

Objective-C singleton dispatch_once weird behavior

I have an Xcode workspace with first Objective-C framework (let’s call it framework #1). This framework has some singletons +(instancetype)shared using the dispatch_once idiom. This code is pretty ...
Khal's user avatar
  • 790

1
2 3 4 5
5849