Questions tagged [objective-c++]

120590 questions
1

votes
0

answer
69

Views

IOS - Connecting to bluetooth device in background periodically

I have a bluetooth device which connects to my iphone and i can perform all sorts of operations on the device. Its a tracking device and I log all sensor based data in the device. Since the device have a data limit, I want to read data from the device once every hour and dump it into a file through...
Kpatel1989
1

votes
1

answer
100

Views

Objective-C protocol delegate not working

I want to send back an array of objects to myViewController from myRenderer In myRenderer.h: @protocol myProtocol; @interface myRenderer : NSObject @property (weak) id myDelegate; @end @protocol myProtocol - (void)sendToMyViewController : (NSMutableArray *) objects; @end In myRenderer.mm (C++ / o...
Brian Scherady
1

votes
2

answer
73

Views

Reset or clear iOS app badge without any app interactions like open the app or push notification

Any possibility to reset/clear app badge without any app interactions such as opening the app or any push/local notifications. My need is, I want to reset my app badge starting off every day without even opening the app or with any notifications.
anasaman_p
1

votes
0

answer
347

Views

Swift class in ObjC Project : Receiver 'MySwiftClass' for class message is a forward declaration

After spending a few hours to integrate swift files successfully to my Objective-C based iOS project, I face the next challenge now : In one of my Objective-C class header (Say, MyObjCClass.h), I do the forward declaration for MySwiftClass. In the respective .m file, I define an instance of MySwiftC...
Harish J
1

votes
1

answer
78

Views

ObjectiveC framework not export some classes

I have developed a tool called EzoRed (ezored.com). It generate a framework for ios or aar for android with native code (c++). When i get the generated xcode project and drag/drop into my sample project, i use the framework without problems. When i drag the generated framework only (With Debug versi...
Paulo Coutinho
1

votes
0

answer
65

Views

resume() does not work if playback was paused for some time in lockscreen

The AVPlayer notify AVPlayerItemFailedToPlayToEndTimeNotification when playing the stream . i use the below code and print the error details : NSError *error = notification.userInfo[AVPlayerItemFailedToPlayToEndTimeErrorKey]; NSLog(@'itemFailedToPlayMPMovieFinishReasonPlaybackError=%@' ,error); Err...
Prashanth Patil
1

votes
2

answer
233

Views

How to convert a AFNetworking code to Alamofire?

I want to convert the following code to Alamofire version, but I'm confused about the AFHTTPSessionManager part. +(void)requestWithUrlString:(NSString *)URLstring method:(NSString *)method parameters:(NSMutableDictionary *)parameters success:(void (^)(id))success faiure:(void (^)(NSError *))failure{...
JsW
1

votes
0

answer
95

Views

Custom button in iOS 11 Number Pad Keyboard Not showing

In our company iPhone app, we are using Number Pad keyboard with a custom button hyphen '-'. Throughout the iOS versions, we had to modify the code as below. Until up to iOS 10, the code below worked fine, but we are having an issue in iOS11. when i tap on the textbox on screen #1, the keypad along...
Robbie H.
1

votes
0

answer
116

Views

Can I call CBPeripheral writeValue:forCharacteristic:type:CBCharacteristicWriteWithoutResponse multiple times?

I need to write different values to a single characteristic very quickly. I'm using [cbPeripheral writeValue:myData forCharacteristic:myCharacteristic type:CBCharacteristicWriteWithoutResponse] Since I'm using WithoutResponse, I can't utilize a callback to know when it's safe to fire off another wri...
Toasty
1

votes
0

answer
214

Views

Apple Music play and pause delay

I have integrated Apple Music in project. When i play or pause it takes delay of 2-3 seconds to come in effect. For example if i pause song it pauses after 1-2 second. I am using following methods to play and pause. To Play : [[MPMusicPlayerController systemMusicPlayer] prepareToPlay]; [[MPMusicPl...
Jagdeep Singh
1

votes
0

answer
46

Views

How should I call the superclass's custom initialiser, when I use a custom one for my subclass?

I'm learning Objective-C and I don't clearly understand what is the best way to call superclass' custom initializer, while defining one in its subclass. Here is my class' (superclass) custom initializer: -(id) initWithWidth:(int)w andHeight:(int)h { self = [super init]; if (self) { [self setWidth:w...
Tigran Iskandaryan
1

votes
0

answer
30

Views

Core Data: split into sections based on custom logic

I have a large data set of objects, made up of 2 large-ish subsets. Set 1 has about 10,000 objects in it. Set 2 has about 70,000 objects in it. The object sets have many-to-many relationships between them. There are also 'favorites' subsets for both sets. Before I display set 1 or set 2, I will have...
mbm29414
1

votes
1

answer
55

Views

ITLibrary gives me nothing but (null)

My program automates a radio station. There is lots of communication back and forth between it and iTunes. I programmed it with scripting bridge. Scripting bridge suffers from memory leaks. Each call to scripting bridge leaks a small amount of memory. Add a lot of calls to a program that runs 24/7 a...
Irv Heller
1

votes
1

answer
862

Views

How to pass a Dictionary to Objective-C method in Swift

I need to pass a Dictionary to a Objective-C method in Swift. In Swift the code is like this: let modelData: Dictionary = getModelData() result = myChilitags.estimate3D(configAt: configFilePath, forModel: modelData); (The configure file has nothing to do with this problem, just ignore it.) I used a...
Jerry Chang
1

votes
0

answer
158

Views

The processing speed between swift and objective-c in Metal

I have written a demo base on apple official document in swift. And I found the usage of CPU is lower in Objective-c than in swift. Does it mean Objective-c is much effective than swift while handling metal app? I'm confused because many people says that swift is faster than Objective-c in general....
Dove Zarchary
1

votes
1

answer
125

Views

eaframework outputstream doesn't work on 11.2.1

- (void)_writeData { while (([[_session outputStream] hasSpaceAvailable]) && ([_writeData length] > 0)) { NSInteger bytesWritten = [[_session outputStream] write:[_writeData bytes] maxLength:[_writeData length]]; if (bytesWritten == -1) { NSLog(@'write error'); break; } else if (bytesWritten > 0) {...
doubll liu
1

votes
0

answer
77

Views

INSendMessageIntentHandling sirkit skipping handleSendMessage intent

I added NSLog(..) statements on each method but it was not going to the handle send message delegate. I need to get some message from Siri to do some tasks. Also, is there any way to get the date/time from speech with INSentMessageDomiain import 'IntentHandler.h' // As an example, this class is set...
Arunava Sanyal
1

votes
0

answer
74

Views

Bluetooth-serial(iOS) + Rongta RPP200-B - slowly and chopped print

I use bluetooth printer Rongta RPP200-B and cordova plugin Bluetooth-serial for printing on mobile devices. On android devices are everthing ok, but on iOS devices is printing very slowly and chopped, especially images are printing very very slowly. I tried to changed native objective-c implementati...
krata
1

votes
0

answer
43

Views

How set the opacity/alpha of an image using OpenGL ES 2.0 and GLKit?

I have create function with OpenGL ES 2.0 and GLKit. I have used GLKBaseEffect for draw GLKTextureInfo and GLKTextureLoader for load PNG file on GLKTextureInfo. (heart.png) Now, I want to set the opacity of the PNG image. This may sound simple, but I have no idea how I can change the opacity...
Easy Soft
1

votes
1

answer
281

Views

Use generic extended swift class in Objective-c

In my project i have many swift classes that extend generic classes. And Now i'm in a need to send data from objective-c class to these swift classes. Is there any possible way to do this ? I have tried using @objc before class as shown below but it didn't allow me to do this. I followed this answer...
Parv Bhasker
1

votes
0

answer
50

Views

async await in objective-c Firebase API

How to change following obj-c Firebase API standard code: void (^block)(FIRDataSnapshot *); block = ^void(FIRDataSnapshot *snapshot) { FIRDatabaseQuery *query; [query observeSingleEventOfType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot * _Nonnull snapshot) { }]; }; FIRDatabaseQuery *query; [qu...
1

votes
1

answer
46

Views

special character like è,á are not converting their respective unicodes in Ios for other platform like android and app website

I am trying this. -(NSString *)convertEmojiIntoUnicode:(NSString *)emojiStr{ NSData *data = [emojiStr dataUsingEncoding:NSNonLossyASCIIStringEncoding]; NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; return goodValue; } For Decoding -(NSString *)convertUnico...
Khalid Moin
1

votes
1

answer
68

Views

Peripheral state never changes after CBPeripheralStateDisconnecting state on mac osx 10.13 CoreBluetooth framework

I have updated macOS to High sierra and Xcode to 9.2. I am working on BLE device connection / disconnection and reading data. It was was working fine in Xcode 8.2, Now there are changes in CoreBluetooth framework. A new state CBPeripheralStateDisconnecting is added in peripheral state. Now, I need...
user8154740
1

votes
0

answer
28

Views

Drag file into the NSTextView, show one warning dialog

ALL: I have one NStextView and when I drag one '.mp4' file into the TextView, a warning dialog will be shown: Do you really want to copy the contents of the dragged items into the text? How can I block this warning dialog? Any suggestion will be appreciated!
stream hu
1

votes
0

answer
49

Views

Use Variable in drawRect

Have a segue FirstView (which works) where an NSInteger value is set; this value gets passed (also successfully) to ViewController. All ViewController does is use - (void)drawRect:(CGRect)rect { in CustomDraw to create graphics (this works when it's a single view app and the integer value is hardcod...
user3741598
1

votes
0

answer
90

Views

Vuforia iOS fit video inside target

I was trying to create combination of cloud recognition and video playback using Vuforia. I can't make it to fit video inside target. Target's on Vuforia website have width set to about 300, and I think, a need to prepare renderFrameWithState function correctly, but I don't know how. Basically, I wo...
Damian Dudycz
1

votes
1

answer
153

Views

React Native events do not work

I have a trivial react component that only shows a button: console.log('test')} title='Button'/> When I put this button into a project I created with react-native init, it works as expected. However, I have an existing project into which I integrated React Native (0.51.0) manually (because it doesn'...
jasamer
1

votes
1

answer
125

Views

Xcode 9 (Objective-C): Loading Custom XIB causes errors NSUnknownKeyException this class is not key value coding-compliant for the key [duplicate]

This question already has an answer here: What does this mean? “'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X” 66 answers I've been doing .net core stuff lately and I have started again with Xcode (and rusty) this time with Xcode 9. I created a...
VinceV
1

votes
0

answer
40

Views

Misplaced UIAccessibilityFrame for UIButton

I'm dealing with a legacy project where all views are created programmatically (no xibs or storyboards). When trying to swipe through accessibility elements in a custom view, the UIButton accessibilityFrame seems to be in the wrong position. Voice over reads it correctly and the accessibility frame...
FromTheStix
1

votes
0

answer
177

Views

Cocoapods use_frameworks with Objective C and Swift mixed project causes issues

I have just started working on Swift 4.0 with my current Objective C project. Everything went fine until I wished to use pods for ALCameraViewController which is built in swift and my previous pods are in Objective C, so I can't enable 'use_frameworks!'. Even if I enable it my project builds success...
Paras Gorasiya
1

votes
0

answer
115

Views

Crashes from network extension not being reported

I have a host app and network extension. Crashes from the host app are being reported correctly, but nothing from the extension. I'm calling [Fabric with:@[[Crashlytics class]]]; from startTunnelWithOptions, and then [[Crashlytics sharedInstance] crash]; at the end of startTunnelWithOptions I have...
janineanne
1

votes
1

answer
140

Views

AVAudioPlayer not playing sound from temp file path

I have saved a recording to my Temp directory and can verify this using iExplorer The file path structure is TempFolder/UserID/SoundName001.wav The bit I save to the database is UserID/SoundName001.wav Here is the code I use to play the file @property (nonatomic, strong) AVAudioPlayer *player; -(voi...
Niall Kiddle
1

votes
0

answer
34

Views

UITextField keyboard pop up after api response received

In my app am using UITextField in the login screen. To get the login details I connect the app to server through API. While calling the api I display an activity UIActivityIndicatorView. Before calling the api I do end editing. once the response is received from server again the keyboard is pop up w...
AJ Sanjay
1

votes
1

answer
31

Views

Objective-C: Pass a map snapshot to view controller in prepareForSegue

I'm trying to segue from a mapView to a page that contains a snapshot of a chosen location on that mapView. Here is my prepareForSegue method: - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@'LocationConfirmSegue']) { LocationConfirmatio...
Philip S
1

votes
0

answer
52

Views

How to know google SDK version ios?

Google has changed policy under which the ads will not display in SDK under version 7.0 any more. How to get SDK version of google admob?
Kevin Maru
1

votes
0

answer
84

Views

AFNetworking Multiple API Calls Around 70 calls at a time

I have created an Abstract class and created get post put delete all the methods, in that and according to their success and failure, I call success and failure. Now for every request I have created a class which initializes the Manager object and the operationqueue object is also created for every...
sumeet agrawal
1

votes
0

answer
571

Views

This NSLayoutConstraint is being configured with a constant that exceeds internal limits. In Google Maps Custom Info Window

When I am trying to add a custom info window to google map's GMSMarker, then I am getting following error: This NSLayoutConstraint is being configured with a constant that exceeds internal limits. A smaller value will be substituted, but this problem should be fixed. Break on BOOL _NSLayoutConstra...
Ravi Kumar
1

votes
1

answer
346

Views

How to check IAP Auto Renewable Subscription was already purchased by Apple ID

I need to get auto-renew subscription working in this project. This project allows a user to sign up to our product after paying for a subscription. This works fine but if I decide to use the same Apple ID to register again, the app doesn't ask me to purchase the membership, instead it says 'You're...
D34thSt4lker
1

votes
1

answer
43

Views

Am stuck in parsing Push Notifications

I want to fetch value of description from the below response. In body few more key-value pairs are there. I have tried, unfortunately am failing to crack. My code is in Objective C. And My code for Parsing as below NSData *jsonData = [NSJSONSerialization dataWithJSONObject:notification.request.conte...
Pavan padmashali B S
1

votes
0

answer
24

Views

Objective C: Exported Sqlite to Email has incomplete Data

I am trying to export the sqlite that I've created for core data to store the records locally to the app that I am developing. I have managed to export the sqlite file via e-mail as attachment, but when I extracted the sqlite file the data is not complete, newly added records aren't shown. Here's my...
Risra

View additional questions