Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
0
votes
0answers
5 views

requestExportSessionForVideo for a PHAsset, callback never called

the code below is to converting the video from album PHAsset* asset = resource; if(asset.mediaType == PHAssetMediaTypeVideo){ NSURL* outputURL = [self generateOutputFileWithExtension:@...
0
votes
0answers
13 views

CEF - Render process methods such as OnContextCreated not being called

Long time lurker, but happy to be here. I'm attempting to bind a basic javascript binding to the cefSimple application. I'm working on an up-to-date Macbook as well as an up-to-date iMac. Numerous ...
0
votes
0answers
5 views

Issue with IOHIDManagerOpen

When using IOHIDManagerOpen on Catalina, I see its throwing up an alert with "application would like to receive keystrokes from any application". The same API is working fine on other platforms, but ...
0
votes
0answers
29 views

What the difference between metal 2 and metal 1? [on hold]

What is the difference between metal 2 and metal 1? Especially about shaders, does the code of shaders the same between metal 2 and metal 1?
0
votes
0answers
12 views

Xcode 11 debugger crashes on breakpoint, can't find Foundation.h

My macOS app compiles and runs fine, but since switching to Xcode 11, I can no longer debug from breakpoints. The debugger always crashes with a bunch of messages like this: warning: Swift error in ...
0
votes
0answers
18 views

What are the differences for polylines between iOs maps and android maps?

I'm converting an iOs app in c# to create a multi-platform version with xamarin.forms. The app presents a map where there are a lot of polylines, created from different jsons of points (latitude and ...
0
votes
0answers
9 views

How to access properties in storyboard of UIViews programmatically

I want to detect a separator in a container layout or container UIView. It is composed of two views as an image. The storyboard shows that it is of type UIView and each of the two subview it ...
0
votes
1answer
29 views

overlay to block and send user to particular screen in swift if logged in [on hold]

So here is the need I already have functions to check if user is logged in. So my need is to have an overlay that will popup if user is already logged in and will have a button that will navigate to ...
-1
votes
1answer
24 views

How to pass data to root controller from one of the sub controller and dismiss all the sub controllers? [duplicate]

I have 4 view controllers lets say A, B, C, and D and all these view controllers will be pushed as A->B->C->D. I have a Dictionary in 'D' and I need to pass this to Dictionary 'A' and I need to ...
0
votes
0answers
20 views

How to extract NSString from NSDictionary that contains nested JSON

I'm trying to get NSStrings from an dictionary but the extracted strings contain the following <__NSSingleObjectArrayI 0x28205fc00>( Aaron ) I expected s plain NSString. Code: NSString *...
-1
votes
0answers
17 views

Not able to get any properties of my another class [objective c]

I have two class namely classA and classB, when tried to access the properties of classA from an instance values are always nil in classB. My code looks like this classA.h @interface classA:...
-1
votes
0answers
12 views

No visible @interface for 'FIRDynamicLinkComponents' declares the selector 'initWithLink:domainURIPrefix:'

NSURL *link = [[NSURL alloc] initWithString:@"https://www.example.com/my-page"]; NSString *dynamicLinksDomainURIPrefix = @"https://example.com/link"; FIRDynamicLinkComponents *linkBuilder = [[...
0
votes
1answer
36 views

Reuse custom TableViewCell

I have a viewController that contains a programmatically created tableView. @property (strong, nonatomic) UITableView *numbersTableView; //... self.numbersTableView = [[UITableView alloc] ...
0
votes
1answer
94 views

ios [NSURL URLWithString:requestUrl relativeToURL:baseUrl]. if requestUrl contains string '/User/Page' , return nil

[NSURL URLWithString:requestUrl relativeToURL:baseUrl] if requestUrl contains '/User/page', return nil. If you want a test. NSString *reqUrl1 = @"/api/v3.1/User​/Page/"; NSString *reqUrl2 = @"...
-2
votes
0answers
19 views

TensorFlow Lite Object Detection always get same result

I found the swift demo.It works well on IOS 12.0. And old version Objective-C demo.but it can not use the model. It's too hard for me to translate the swift demo into Objective-C. I tried this so ...
0
votes
0answers
15 views

How could I launch keyboard programmatically on Catalina (10.15)?

I want to launch a screen(virtual) keyboard by NSAppleScript on macOS APP. The following code is work finely before macOS Catalina (10.15). All need permission is allowed. NSString *theApplication ...
0
votes
1answer
13 views

CallKit reinitializing causes com.apple.CallKit.error.requesttransaction Code=4 (UnknownCallUUID)

My iOS VoIP app uses CallKit in order to support native call integration feature. At first launch everything is working fine, but if I reinitialize CXProvider and CXCallController (in order to disable/...
0
votes
1answer
20 views

How to get name or identifier for a UIView component

In the below code I want to have any identifier to the -firstView- as shown below in the code. I attempted the following: //NSLog(@"_[uiviews[0] _description] = %@" , [uiviews[0] _description]); //...
-1
votes
0answers
29 views

Digitally sign with a Bluetooth smart card reader? [on hold]

In Objective-c, I need to sign documents with the bluetooth card reader that contains the gsm card. I tried Apdu commands, but I failed. I need to pull the certificate information and verify the ...
0
votes
2answers
35 views

WARNING-[UIApplication delegate] must be used from main thread only

I am getting warning [UIApplication delegate] must be used from main thread only in the below line of code ((AppDelegate *)[[UIApplication sharedApplication] delegate]).loginProfile.accessToken; ...
0
votes
0answers
18 views

objective c scrollview screenshot have a issue in ios 13

Code that worked well before ios 13 has problems with ios 13. The code below is the code that gets the same image as the screen capture of the entire scroll view. UIGraphicsBeginImageContext(...
1
vote
0answers
21 views

UICollectionView incorrectly hides cells whiles panning and scrolling

I have a UICollectionView with a custom layout. The layout extends UICollectionViewLayout, not flow layout, and I override the following methods: collectionViewContentSize ...
0
votes
0answers
8 views

Check if User is Logged into iCloud? Swift/iOS (Objective-C)

I am referring this question from the stack question: Check if User is Logged into iCloud? Swift/iOS I saw the two answers given below. Could someone help me with the objective-c implementation of it?...
0
votes
1answer
21 views

Incompatible block pointer types - Objective-c

I want to call following code with return statement in main thread but I got below error. Incompatible block pointer types passing 'NSString *(^)(void)' to parameter of type 'dispatch_block_t ...
0
votes
0answers
9 views

iOS crash on cocos2d::Ref::~Ref()

Well, I use analytic tool to collect crash bugs, the iOS game app crash at "cocos2d::Ref::~Ref()", I have not learned the language c++ and almost do not know cocos2d-x, please do me a favor if you ...
0
votes
0answers
17 views

Obj-C / iOS - Debugging Crash on Release build w NSURLConnection?

I recently uploaded my app to the app store - when I run it on my own device and in the simulator in debug mode, everything works great. However, as soon as I run the release build on TestFlight, it ...
0
votes
0answers
19 views

“Unknown type name 'tls_protocol_version_t' on the class NSURLSession”

In Xcode 11 the compiler show me "Unknown type name 'tls_protocol_version_t' on the class NSURLSession", i already tried deleting deriving data, cleaning and compiling, it's work fine in xcode 10, but ...
0
votes
0answers
9 views

iOS 13 AVAudioSession causing UniPay swiper to not work

I have an app using the UniPay II credit card swiper. This swiper uses the audio jack and now in iOS 13 I am getting the following error when making the API calls: AVAudioSession.mm:998:-[...
0
votes
2answers
31 views

How do I repurpose JSContext in UIWebView to WKScriptMessage for WKWebview

I want to convert a UIWebView library to use WkWebview. The remaining piece is switching out JSContext because the valueForKeyPath doesn't work anymore. So how do I rewrite something like the ...
0
votes
0answers
18 views

Modifying Expo-AV Native Objective-C modules to handle audio interruption during recording - React Native

Goal: Record audio from phone for 8 continuous hours while application is in the background and the phone is closed. In the event of audio interruptions (phone calls, alarms, music, etc.), pause ...
0
votes
1answer
22 views

[NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance

I get JSON data and store it in `NSUserDefaults' which then I am trying to retrieve to add or remove objects from the dictionary, however I get the error unrecognized selector sent to instance ...
0
votes
0answers
13 views

Error uploading image to server in objective c

I am trying to upload image to the server. But i am getting error like- Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString CGImage]: unrecognized selector ...
0
votes
0answers
9 views

How to get plist in a Cocoa touch framework project? [duplicate]

I am developing a Cocoa Touch framework. Inside this project I have a plist file which I use in my methods (of the framework) to get some information. I have tried using the next for getting plist ...
0
votes
0answers
11 views

How to set font appearance for labels in table view headers

How do you set the appearance of table view headers in iOS 13? This used to work but in iOS 13 when the header views get reused the font gets reset now. Other appearance properties like text colors ...
0
votes
0answers
10 views

NSCollectionView won't accept drops onto an item [duplicate]

I'm trying to make a collection view that will accept drops of files from the Finder. My delegate's validateDrop method always returns NSDragOperationGeneric. If the proposed drop operation is ...
0
votes
0answers
12 views

IONIC 3 - Get Base64 from video file in IOS

I'm using this plugin for make videos https://github.com/icetec-solutions/cordova-plugin-camera-preview and I'm trying to convert the video file to base64 for use in API route, but the following ...
0
votes
0answers
8 views

How can I determine that Quick Actions are available for “Long Press”?

My iOS-application has a setting for Quick Actions. So far I have revealed that setting after checking that the device support Force Touch using this piece of code: if ([self.traitCollection ...
-4
votes
0answers
35 views

Does swift can write more secure code than objective C? [on hold]

I need to build a new iOS app. I want to write more secure code for the app. Should I use Swift instead of Objective C? Please advise. Thanks!!
2
votes
0answers
32 views

Undefined symbol: _OBJC_CLASS_$_WKInterfaceController error after updating XCode to version 11.1

I updated Xcode to version 11.1 and got this expected error: WatchKit is not available when building for iOS Simulator. Then I deleted WatchKit from iOS app target as suggested. Since then I am ...
0
votes
0answers
14 views

Using safeAreaInsets get the top edge of my UIWindow's safe area works in iOS 13, but not iOS 11?

I have a method in my portrait-orientation iOS app that attempts to return the value in points of the top edge of the main window's safe area, using safeAreaInsets: + (double)screenTopEdge { ...
-1
votes
0answers
30 views

Need help rotating video in iOS

I am trying to understand video in iOS so I started with the AVCam example form Apple. I have used this code, almost pulled exactly from the example. BUT, the code returns video rotated 90 degrees. ...
-1
votes
0answers
15 views

Crashes in basic property access after iOS 13?

I am getting crashes on very simple object access after upgrading to iOS 13. See examples below. I wonder if there is some change to the language or to default settings in Xcode causing these? Or ...
0
votes
0answers
38 views

Read Data from a Realm object

I have a realm object written in objc, but I want to read data from it from a swift file. However, when I try to use RLMResults or let values = secondActivity.allObjects() it gives me an error. How ...
0
votes
0answers
20 views

Disable logging for CocoaPods

I am using several CocoaPods in my project. Some of them are outputting strings to the console via NSLog(). How can I disable all logging from CocoaPods? I basically want to add this to all the .pch ...
0
votes
1answer
16 views

NSButton highlight on mouse over and toggle state via click

In Xcode, there is an 'In My Scope' button which highlights when you mouse over and stays highlighted until its 'unclicked'. I can reproduce this via interface builder with the following: Xcode 'In ...
0
votes
1answer
12 views

How can I make a line chart without visible axis that fully fills its view?

I have a chart which is styled like so, but the chart does not fill the view, it seem to maintain a spacing between the edges, as if to allow for the axis labels to be drawn. How can I force the ...
0
votes
0answers
23 views

C standard library HTTP 301 Redirect using sockets on Objective-C

I'm a very beginner on using sockets with C standard library in Objective-C. I'm trying to make HTTP requests to fetch pages on a self-developed browser, to this we're using a query request such as ...
-1
votes
1answer
24 views

iOS 13: Facebook Login not working in objective c

Facebook Login not working in objective c.Its working in iOS 12 but not working in iOS 13. Does anyone know how to fix this?
0
votes
1answer
36 views

IOS objective C selector using the wrong scope

I'm using a custom class to hold the initiation code for a particular set of UITextField settings and inputAccessoryView @interface CustomCountKeyboard : NSObject It has the below method for ...
0
votes
0answers
33 views

iOS: Problem with my drawing popover that doesn't display well since iOS13

I display a popover that's allows to draw inside. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { mouseSwiped = NO; UITouch *touch = [touches anyObject]; lastPoint = [...