iOS Question Problems with OBJC

Discussion in 'iOS Questions' started by fbritop, Jul 2, 2015.

  1. fbritop

    fbritop Active Member Licensed User

    Hi there,
    After installing b4i 2.0 I could never compile again any programs that contains OBJC tags.

    Within my code I have the following OBJC Sub

    Code:
    #If OBJC
    @import CoreTelephony;

    - (NSString *) SIM
    {
        NSString *nameComplete;
        CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init];
        CTCarrier* carrier = info.subscriberCellularProvider;
        NSString *mobileCountryCode = carrier.mobileCountryCode;
        NSString *carrierName = carrier.carrierName;
        NSString *isoCountryCode = carrier.isoCountryCode;
        NSString *mobileNetworkCode = carrier.mobileNetworkCode;
        nameComplete = [NSString stringWithFormat: @"%@;%@;%@;%@", mobileCountryCode, carrierName ,isoCountryCode, mobileNetworkCode];
        return nameComplete;
    }
    #end if
    But I keep getting this error when I compile:

    import of module 'CoreTelephony' appears within 'b4i_main'

    Out: Build settings from command line:
    ARCHS = armv7
    CODE_SIGN_IDENTITY = iPhone
    CONFIGURATION_BUILD_DIR = /Users/administrator/Documents/UploadedProjects/XXXXXXX/Payload
    OTHER_CODE_SIGN_FLAGS = --keychain XXXXXXX
    PRODUCT_NAME = LlaveMovil
    PROVISIONING_PROFILE = XXXX...

    This error was not happening before installing b4i 2.0. I have tried to compile with both, 1.5 and 2.0

    Any thoughts on what am I doing wrong?

    Thanks
    FBP
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    It is fixed for the next update.
     
    fbritop likes this.
  3. fbritop

    fbritop Active Member Licensed User

    Erel,
    I found a workarround which did work

    Code:
    #If OBJC
    //@import CoreTelephony;
    #import<CoreTelephony/CTCallCenter.h>   
    #import<CoreTelephony/CTCall.h>  
    #import<CoreTelephony/CTCarrier.h>   
    #import<CoreTelephony/CTTelephonyNetworkInfo.h>

    - (NSString *) SIM
    {
        NSString *nameComplete;
        CTTelephonyNetworkInfo* info = [[CTTelephonyNetworkInfo alloc] init];
        CTCarrier* carrier = info.subscriberCellularProvider;
        NSString *mobileCountryCode = carrier.mobileCountryCode;
        NSString *carrierName = carrier.carrierName;
        NSString *isoCountryCode = carrier.isoCountryCode;
        NSString *mobileNetworkCode = carrier.mobileNetworkCode;
        nameComplete = [NSString stringWithFormat: @"%@;%@;%@;%@", mobileCountryCode, carrierName ,isoCountryCode, mobileNetworkCode];
        return nameComplete;
    }
    #end if
    On the other hand, do you know any simple device (a bluetooth button), that when the user press this button, and the device is paired with the phone, then it performs some action over the app on the device, that it would work on both iOs and Andoird?

    Thanks
    FBP
     
    Erel likes this.
  4. Erel

    Erel Administrator Staff Member Licensed User

    I'm not familiar with such device. Sorry.
     
Loading...