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

why the address of a number's pointer increase by one byte, not eight bytes in iOS with 64-bit architecture?

the code for test: NSNumber *n1 = @1; NSNumber *n2 = @2; NSNumber *n3 = @3; NSLog(@"\n- %p\n - %p\n - %p\n", &n1, &n2, &n3); the address number's pointer: // pointer ...
0
votes
0answers
6 views

iOS App - Is it possible to add widget to Today View from the app itself?

So when we add widgets to Today View, we usually swipe to the left, press edit, and add the widget for the desired application. Is it possible to do that from inside the app itself? Thank you. Ps. I ...
0
votes
0answers
14 views

How can I cast a '[Int]' too an 'UnsafeMutablePointer<Int32>?'?

I have a variable called time_diff in an app I'm making. I need to pass it into an obj-c function that takes UnsafeMutablePointer?. Swift: var time_diff = [Int](repeating: 0, count: MAX_NODE) Obj-C ...
-1
votes
0answers
22 views

Issue storing a iOS device token in a MySQL Database using PHP

Ok, so I have everything setup on my backend to send Push Notifications to users of my iOS app. I have developed this app using Fuse Tools (https://fuseopen.com) and I am attempting to retrieve my ...
0
votes
0answers
14 views

NSLocalizedString not saving value

This code is not saving "Add notes" into placeholderText, but instead it is saving just "blog_add_notes". I also tried to cast it to String but it doesn't work. - (void)viewDidLoad { [super ...
0
votes
0answers
7 views

Change chevron color by replacing it in modifyCell with new sf symbol chevron.right

Id like to use the system image chevron.right for my accessory icon and replace what is currently there so I can control the color. Right now with iOS 13+ the tint color is not updating like the text ...
1
vote
1answer
20 views

ios UITableview multiple select options on single cell?

Has anyone found a really good way to handle this case in UI? We have a tableview with a list of items (long list). Each item is a row and it can be either "selected" or it can be drilled into to ...
1
vote
1answer
24 views

Define semi public variable in objectiveC

I'd like to define a member in objective C class that can only be read outside the class (public getter). The writing (setter) however shell remain private. I've read that It's possible to conceal ...
0
votes
0answers
11 views

How to check which thread is running with high CPU iOS

My application sometimes but not always consume high CPU in background more than 100%, as my project little bit complex with many libraries and class, I tried with instrument to check which thread ...
0
votes
0answers
27 views

macOS Catalina screen recording permission

I am working on a screen recording app using C++ in XCode. The problem is that when I compile and start the app I always have to give permission for screen recording in "Settings > Privacy". Is ...
-2
votes
0answers
14 views

Dissolve the view when we swipe from top to bottom

ViewController 1 - List of images in CollectionView When the user clicks on an image, we are presenting modally with the transition as cross dissolve to VC2. ViewController 2 - Selected image ...
0
votes
0answers
17 views

syntax error with dynamic ALTER sqlite3_bind_text statement in obj-c

This code throws a error [logging] near "?": syntax error in "ALTER TABLE jobs ADD COLUMN ? text" NSArray *uArray = [NSArray arrayWithObjects:@"string1", @"string2", @"etc", nil]; const char ...
0
votes
0answers
11 views

How to print the names of all Objective-C classes in an iOS binary?

I want to print the names of all Objective-C classes found in an iOS binary using "otool" or "objcdump". I am doing this on macOS, on an iOS binary that is not encrypted. What I tried: Solution ...
0
votes
0answers
17 views

How can WKWebView read shorten URL?

How can WKWebView read shorten URL? There are two senorio . I have tried to init a WKWebView and loadRequest with shorten URL(like:https://bit.ly.xxxxxx) it works. it goes to ...
0
votes
0answers
13 views

Face ID matching not working in iOS simulator

Migrating my code to Xcode 11 and run the app in the iPhone Pro Max simulator. I'm trying to match the face ID and it's throwing an error with status code -25300. But it's working as expected in the ...
-3
votes
1answer
36 views

Delegate method when Deleting or Offload App

Is there a delegate method in iOS when application is about to be delete or Offload the App?i'm trying to send a some data to server
2
votes
1answer
38 views

Error Domain=WebKitErrorDomain Code=102 “Frame load interrupted”

Getting an error while showing pdf in WebView "Error Domain=WebKitErrorDomain Code=102 "Frame load interrupted" But with the same code image is populating correctly.
0
votes
1answer
35 views

How to check if a Singleton object is already initialized or not in Objective-C?

I have a Singleton class in Objective-C. I want to know if the shared object is already initialized or not, before accessing sharedInstance. How can I do so? + (id)sharedInstance { static ...
0
votes
0answers
26 views

UIImageJPEGRepresentation not working in iOS 13.2.3

I am using the following code to convert UIImage to NSData: imgData = UIImageJPEGRepresentation(image, 0.75); The code is working fine with iOS 12.4, but when I try with it with iOS 13.2.3, it ...
1
vote
1answer
39 views

Keyboard bottom corner icons change color in iOS

I dont want my buttons on my keyboard to change colors if I globally update all buttons to have the same color. How can I control this manually to reset to the original color? [[UIApplication ...
-1
votes
1answer
33 views

Weird autolayout centering issue

This has been dogging me a bit. Basically, what it comes down to is that when I manually define autolayout constraints using layout anchors, and use the view controller in a popover, the center is in ...
0
votes
0answers
12 views

NSTextAttachment not drawing in custom NSView in Catalina [closed]

I have an NSTextAttachment subclass that renders fine when used in an NSTextField, but doesn't render when drawn in a custom view (inside an NSMenuItem) via NSAttributedString's drawInRect call. Text ...
-1
votes
0answers
22 views

Is there an easy way to build a NSScrollView subclass that shows the vertical scroller on the left instead that on the right?

on macOS, in Swift or Objective-C is it possible to build a NSScrollView subclass that shows the vertical scroller to the left of the view instead that on the right ? Many thanks for any help.
0
votes
0answers
19 views

ViewController Only Presented after User Touches the Screen

I have an app in which I present a menu modally. Then, when the user selects a menu option, the menu dismisses itself and upon completion, presents another view modally according to what button the ...
0
votes
0answers
23 views

Share articles on linkedin not working with new v2 Api's

We have an app where we are using social media share with Linkedin, earlier the app was using v1 Api and post share was working fine, but now all of the sudden it has stopped working. I checked on ...
0
votes
0answers
8 views

Failure after calling PKAddPaymentPassRequest handler

I'm working on "Adding card to wallet" functionality, got all permissions related. I'm not able to find any better documentation. Completed the following steps PKAddPaymentPassViewController with ...
-3
votes
0answers
21 views

How can i fix this issue? - Initializer for conditional binding must have Optional type, not 'TimeInterval' (aka 'Double') [closed]

enter image description here If i make @objc dynamic var gap: TimeInterval = 0.0 like this, this time i get this issue: Initializer for conditional binding must have Optional type, not '...
0
votes
0answers
20 views

How to simulate screen size of 1125 X 2001 in iOS simulator

iPhone plus sized devices run in 1125 X 2001 resolution in zoomed mode ( iPhone Settings App -> Display & Brightness -> Display Zoom ) Click here to find more information on Zoomed Mode. Now the ...
0
votes
1answer
16 views

UI blocking when trying to save data in txt file in iOS

I'm trying to save recieving values in Txt file in delegate method using the below code. Those are Integer values, i'm putting those values in graph meanwhile saving in txt file. but saving values in ...
0
votes
0answers
27 views

Swift port of GNU patch

I'd like to apply patches generated with GNU diff to a large text file in an App on iOS. However, I've failed to locate an implementation in Swift or Objective-C compatible with GNU patch. Has anybody ...
0
votes
0answers
10 views

iOS Objective-C Turn off Proximity Monitoring while VoiceOver is active

I would like to disable Proximity Monitoring, so that screen remains always ON, not matter how close something is to the sensor. I tried it by using: UIDevice.currentDevice....
0
votes
2answers
40 views

'init' is unavailable when trying to use swift object in objective-c class

I have a swift object but when I try using it in an objective-c class I get 'init' is unavailable, why is this? my Swift class is as shown below: import Foundation @objc public class OsonOptions : ...
0
votes
1answer
23 views

AES128 Encryption CBC/NoPadding Objective-C

We need to encrypt a request using AES128 in Android and IOS and then send that encrypted message in the backend server written in Java. Our Android encryption code is like below: Cipher cipher = ...
0
votes
1answer
27 views

How to add constraints for dynamic appending input fields in custom cell

how can I achieve the dynamic height of the cell while adding dynamic input fields in a custom table cell - (IBAction)clickButtonAdd:(id)sender { NSLog(@"test chekboc"); CGFloat y ; ...
0
votes
1answer
15 views

Sanboxed app, include files by reference?

So I have a sandboxed app, which allows users to drag and drop files from Finder onto a project window. I would like to use these files from their existing location, ie by reference, rather than copy ...
0
votes
2answers
61 views

UIButton title text selecting a particular text and Copy it

How can I select a particular text from UIButton title text and copy it like UITextField?
0
votes
0answers
22 views

FSCalendar: prevent automatic scrolling when date from other month is selected

The default behavior of FSCalendar is that if a month is currently being displayed (for example December) and the user taps to select a day from the previous month (November), the calendar will scroll ...
0
votes
0answers
27 views

Is it possible to accept multiple (> 2) calls through CallKit's “Accept and Hold” button?

I have implemented CallKit for a VoIP app. The "accept and hold" behaviour works well: the active call is put on hold and the new call is accepted. But when I have one call active, one call on hold ...
1
vote
1answer
42 views

How to create an Objective-C project in an old version

I have to create an application with a minimum version in iOS 6.0 and Objective-C. How can I create a new project in that version? I've tried creating a normal project and switching to iOS 6 later, ...
-3
votes
0answers
32 views

NSTextAttachment on place line breaking in UITextView

I have custom UITextView with attributed string. Inside words have NSTextAttachment with icons. I set NSParagraphStyle lineBreaking = .byWordWrapping but words line breaking to place NSTextAttachment. ...
0
votes
1answer
23 views

How to format date 12/2/31 H, 2:21:41 AM in Objective-c?

This is what date I am getting again our current date of 2019. 12/2/31 H, 2:21:41 AM Can anyone help me how can I parse this date to NSDate object in Objective-c?
-1
votes
1answer
31 views

Xcode 10, 11 - failed to emit precompiled header

I have taken a project from another laptop to mine. In the other mac it works without any issues but in mine, I am getting this issue - failed to emit precompiled header '/Users/appinventiv-adi/...
-2
votes
2answers
66 views

Difference between two NSDates in Months and Years in Swift iOS

I have to calculate the time between two NSDates in Month + Year. Example 1: Start Date: September 2018 End Date: May 2019 So I have to get the difference between these two dates and have to ...
0
votes
0answers
24 views

How to remove UIWebView component completely in current project?

when submitting my latest build, Apple has a response with this warning. ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs . See https://...
0
votes
1answer
17 views

Create Cipher Instance Objective C and get Block Size

We have a requirement to create same encryption method for Android and IOS. We already have an existing working code written and Java but I am struggling to find the equivalent solution in Objective C....
0
votes
0answers
35 views

iOS App Login integration with Facebook with Xcode 11.2.1

I have an iOS template APP which has a login page once we run the app. (It has Email login and Facebook Login) I haven't setup the API or anything yet. There is a file called ApiConfig.h in the ...
-1
votes
1answer
42 views

Check if location is known

I see many questions and answers about whether location is permitted by the user etc. This is not my question. I want to know whether location is known to the device. Even if location is permitted ...
1
vote
1answer
41 views

[NSPopupButton performClick]: menuDidClose: not being called immediately

I use -[NSPopupButton performClick:nil] to programmatically popup the menu of an NSPopupButton. Even though the delegate of the NSPopupButton's menu is correctly set, the delegate's menuDidClose: ...
0
votes
0answers
11 views

Generated Protobuf objc .m file has incorrect #import

I've tried to generate objc protofiles for each subfolder from root: protoc */*.proto --objc_out="../result" -I. Example proto: syntax = "proto2"; message MyProtoType { required string ...
0
votes
0answers
9 views

Empty screen after dismissing another UIViewController or QLPreviewController

I have an existing application with a main UIViewController initiated with a nib/xib. Before I touch anything, the xib file was referencing a webview. I removed it and created it programatically in ...