I am trying my first build for android using Apportable, from a simple iOS app. Getting the following error:
use of undeclared identifier 'AVAudioSessionPortOverrideSpeaker'
The code in my iOS app is as following:
if([session respondsToSelector:#selector(overrideOutputAudioPort:error:)])
[session overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:&setOverrideError];
Can somebody guide me how I should change my objective C code to make it work with Apportable?
you forget to import module
#import AVFoundation;
Related
when I want use swift file in objective c project and I declare an object from swift class, I get "Use of undeclared identifier" error.
the way that I pass:
coping swift file in project and type #objc before declare swift class
create header file in project manually
set "Defines module" in target to Yes
set objective-C bridging header in target to $(SRCROOT)/$(PRODUCT_MODULE_NAME)-Bridging-Header.h
declare #import "productModuleName-Bridging-Header.h" in objective-c file
use name_of_swift_class *s = [[name_of_swift_class alloc] init];
when I want use swift file in step 6 I get "Use of undeclared identifier" error. why?!!! do I have the mistake?
when I test this steps in new project I don't get error but in project that I want it return error.
thank you for your help
The problem is at Step 5 You should not be importing "productModuleName-Bridging-Header.h" instead you should be importing "productModuleName-Swift.h"
P.S- After making this change clean your project, clear your derived data and build it. It will work. Hope it helps :)
When I'm trying to build this project in Xcode8 I get this error
use of undeclared identifier 'GAdInterstitialKey_Live'
on this line
interstitial = [[GADInterstitial alloc] initWithAdUnitID:GAdInterstitialKey_Live];
Do you have that string in some part of your code? By the way, are you using admob? Interstitial might be related to it.
Assuming you are using something like admob you have to define keys provided by the service to relate the user to your app. You might not have defined then or dit it in a wrong way.
I'm working on an objective-c project. I added a swift framework, which gave me errors.
When I touch "command" can find the file. When I use #import also can add "ChartLineView.swift".
But when I implement it as,
ChartLineView *cl = ....
I get an error, " Use of undeclared identifier LineChartView"
What could be wrong?
I guess your are having issue in importing swift library(added via cocoapods) in your Objective C project. Just go in your .m file and import the swift library like this.
#import LineChartView; // i suppose LineChartView is the swift library name.
I am using 3rd party external framework in my objective-c project. I created an swift file in this project to use the framework.
In MyModule-Bridging-Header.h I have import external framework header
#import “ext-service/ext-service.h”
In the ext-service.h there is an constant:
typedef NS_ENUM(NSInteger, service_err_t) {
SERVICE_SUCCESS = 1
}
In my swift code
//Compiler error: use of unresolved identifier ‘SERVICE_SUCCESS’
if result == SERVICE_SUCCESS{
NSLog(“successful!”)
}
But I get compiler error:
use of unresolved identifier ‘SERVICE_SUCCESS’
Why?
The reason to the error you mentioned is SERVICE_SUCESS is unavailable(unknown).
There are 2 possible solutions:
Use service_err_t.SERVICE_SUCCESS instead of SERVICE_SUCESS
result is of type service_err_t then just using .SERVICE_SUCESS
Hope this helps!
I have a .m and .h file that generated with Thrift for objective-c based on this link :
http://wiki.apache.org/thrift/ThriftUsageObjectiveC
but there are a lot of error in .m files like :
1. error: duplicate interface definition for class
2. reimplementation of class 'bitlit_thrift_detect_cover_args'
3. use of undeclared identifier '__claim_id'; did you mean 'claim_id'?
4. use of undeclared identifier '__claim_id_isset'
5. reference to local variable 'claim_id' declared in enclosing context
6. error: use of undeclared identifier '__claim_id_isset'
__claim_id_isset = YES;
.....
7. fatal error: too many errors emitted, stopping now [-ferror-limit=]
would you please give me some hints, what is the problem?, is the error related to the xcode setting? my xCode Version is Version 4.6.1
Thanks in advance!
Here is the errors Picture: