Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: (IOS) Objective C class Reachability can not be found



Permlink Replies: 4 - Last Post: Aug 26, 2017 2:13 AM Last Post By: Yves Depreitere Threads: [ Previous | Next ]
Yves Depreitere

Posts: 52
Registered: 5/20/02
(IOS) Objective C class Reachability can not be found
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 9, 2017 11:48 AM
using http://delphiworlds.com/2013/11/checking-for-an-internet-connection-on-mobile-devices-with-delphi-xe5/

I can run the sample Delphi demo, but when I add the .pas files to a CBuilder project I get the "Objective C class Reachability can not be found" error

What am I missing ? I did add the extra framework

//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
 
#include "Main.h"
#include "NetworkState.hpp"
 
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TFrmMain *FrmMain;
//---------------------------------------------------------------------------
__fastcall TFrmMain::TFrmMain(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFrmMain::Button1Click(TObject *Sender)
{
TNetworkState *NetworkState = new TNetworkState ();
if (NetworkState->IsConnected ())
   {
   Label1->Text = "Not reachable";
   }
else if (NetworkState->IsWifiConnected ())
   {
   Label1->Text = "Reachable via WiFi";
   }
else if (NetworkState->IsMobileConnected ())
   {
   Label1->Text = "eachable via WWAN";
   }
delete NetworkState;
}
Remy Lebeau (Te...


Posts: 8,839
Registered: 12/23/01
Re: (IOS) Objective C class Reachability can not be found
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 9, 2017 12:14 PM   in response to: Yves Depreitere in response to: Yves Depreitere
Yves Depreitere wrote:

using
http://delphiworlds.com/2013/11/checking-for-an-internet-connection-on-mobile-devices-with-delphi-xe5/

I can run the sample Delphi demo, but when I add the .pas files to a
CBuilder project I get the "Objective C class Reachability can not be
found" error

If you read the comments on that same page, several other people were
having that same error, but no comment about how to fix it.

--
Remy Lebeau (TeamB)
Yves Depreitere

Posts: 52
Registered: 5/20/02
Re: (IOS) Objective C class Reachability can not be found
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 9, 2017 11:48 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Yves Depreitere wrote:

using
http://delphiworlds.com/2013/11/checking-for-an-internet-connection-on-mobile-devices-with-delphi-xe5/

I can run the sample Delphi demo, but when I add the .pas files to a
CBuilder project I get the "Objective C class Reachability can not be
found" error

If you read the comments on that same page, several other people were
having that same error, but no comment about how to fix it.

--
Remy Lebeau (TeamB)

Thanks Remy.
I did read the comments and noticed some were using the simulator, they needed another lib for 64bit and/or needed to add the framework.
At first glance I didn't see anyone mentioning using the code from within CBuilder.
The article is rather old, so I tried to get an answer here.
Yves Depreitere

Posts: 52
Registered: 5/20/02
Re: (IOS) Objective C class Reachability can not be found
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 13, 2017 1:17 AM   in response to: Yves Depreitere in response to: Yves Depreitere
Yves Depreitere wrote:
using http://delphiworlds.com/2013/11/checking-for-an-internet-connection-on-mobile-devices-with-delphi-xe5/

I can run the sample Delphi demo, but when I add the .pas files to a CBuilder project I get the "Objective C class Reachability can not be found" error

What am I missing ? I did add the extra framework

//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
 
#include "Main.h"
#include "NetworkState.hpp"
 
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TFrmMain *FrmMain;
//---------------------------------------------------------------------------
__fastcall TFrmMain::TFrmMain(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFrmMain::Button1Click(TObject *Sender)
{
TNetworkState *NetworkState = new TNetworkState ();
if (NetworkState->IsConnected ())
   {
   Label1->Text = "Not reachable";
   }
else if (NetworkState->IsWifiConnected ())
   {
   Label1->Text = "Reachable via WiFi";
   }
else if (NetworkState->IsMobileConnected ())
   {
   Label1->Text = "eachable via WWAN";
   }
delete NetworkState;
}

Nobody? Does anyone know any other method of checking the existance of Wifi?

Thanks,
Yveske
Yves Depreitere

Posts: 52
Registered: 5/20/02
Re: (IOS) Objective C class Reachability can not be found
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 26, 2017 2:13 AM   in response to: Yves Depreitere in response to: Yves Depreitere
Yves Depreitere wrote:
using http://delphiworlds.com/2013/11/checking-for-an-internet-connection-on-mobile-devices-with-delphi-xe5/

I can run the sample Delphi demo, but when I add the .pas files to a CBuilder project I get the "Objective C class Reachability can not be found" error

What am I missing ? I did add the extra framework

//---------------------------------------------------------------------------
#include <fmx.h>
#pragma hdrstop
 
#include "Main.h"
#include "NetworkState.hpp"
 
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TFrmMain *FrmMain;
//---------------------------------------------------------------------------
__fastcall TFrmMain::TFrmMain(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TFrmMain::Button1Click(TObject *Sender)
{
TNetworkState *NetworkState = new TNetworkState ();
if (NetworkState->IsConnected ())
   {
   Label1->Text = "Not reachable";
   }
else if (NetworkState->IsWifiConnected ())
   {
   Label1->Text = "Reachable via WiFi";
   }
else if (NetworkState->IsMobileConnected ())
   {
   Label1->Text = "eachable via WWAN";
   }
delete NetworkState;
}

Please vote: https://quality.embarcadero.com/browse/RSP-18862
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02