Hello,
I was able to build a very simple server using Delphi and FMX that would run on Mac OS X, after that I used the ROServiceImporter to import Objective C files for the native Mac OS X client, the server is built using code first, however, I spent too much time altering the code generated for the AccessServer class to make it work and make Xcode happy!
Can you please have a look and let me know if the generated code is correct, for the header for example, your generated code is:
#import <Foundation/Foundation.h>
#import <RemObjectsSDK/RemObjectsSDK.h>
@class ServerAccess;
@interface ServerAccess ROClientChannelDelegate
{
ServerAccess *_sharedInstance;
NSURL *__p_serverURL;
}
@property (nonatomic, strong) ServerAccess *sharedInstance;
@property (nonatomic, strong, readonly) NSURL *serverURL;
@property (nonatomic, strong) Demo9Service_AsyncProxy *demo9Service;
@end
I modified it to be able to create an instance of this class:
#import <Foundation/Foundation.h>
#import <RemObjectsSDK/RemObjectsSDK.h>
import “DemoSDK9_Intf.h” // No import!!!
//@class ServerAccess;
@interface ServerAccess : NSObject<ROClientChannelDelegate>
{
ServerAccess *_sharedInstance;
NSURL *__p_serverURL;
}
+ (ServerAccess *)createServerAccess;
@property (nonatomic, strong) ServerAccess *sharedInstance;
@property (nonatomic, strong) NSURL *serverURL; // Changed it to be able to set it up!!!
@property (nonatomic, strong) Demo9Service_Proxy *demo9Service;
@end
The implementation file generated by the import utility is as follows:
@implementation ServerAccess
static __strong ServerAccess *_sharedInstance;
+ (ServerAccess *)sharedInstance
{
if (self->_sharedInstance == nil)
self->_sharedInstance = [[ServerAccess alloc] init];
return self->_sharedInstance;
}
@synthesize serverURL = __p_serverURL;
- (Demo9Service_AsyncProxy *)demo9Service
{
id service = [[RORemoteService alloc] inittargetURL:self.serverURL serviceName:@"Demo9Service"];
service.channel.delegate = self;
return [[Demo9Service_AsyncProxy alloc] initservice:service];
}
@end
Modified to work as follows:
#import "DemoSDK9_ServerAccess.h"
@implementation ServerAccess
static __strong ServerAccess *_sharedInstance;
+ (ServerAccess *)createServerAccess
{
if (_sharedInstance == nil)
_sharedInstance = [[ServerAccess alloc] init];
return _sharedInstance;
}
@synthesize serverURL = __p_serverURL;
- (Demo9Service_Proxy *)demo9Service
{
RORemoteService *service = [[RORemoteService alloc] initWithTargetURL:self.serverURL serviceName:@"Demo9Service"];
service.channel.delegate = self;
return [[Demo9Service_Proxy alloc] initWithService:service];
}
@end