IOSAD-49 forbids access to init for clients IOSAD-49
authorbuff <andreas@pep-project.org>
Fri, 06 Oct 2017 12:11:30 +0200
branchIOSAD-49
changeset 2573720764b9381
parent 256 1bd5a42b35ee
child 258 41f1104803f1
IOSAD-49 forbids access to init for clients
pEpObjCAdapter/PEPSession+Internal.h
pEpObjCAdapter/PEPSession.m
     1.1 --- a/pEpObjCAdapter/PEPSession+Internal.h	Fri Oct 06 09:52:54 2017 +0200
     1.2 +++ b/pEpObjCAdapter/PEPSession+Internal.h	Fri Oct 06 12:11:30 2017 +0200
     1.3 @@ -13,6 +13,8 @@
     1.4  
     1.5  @property (nonatomic) PEP_SESSION session;
     1.6  
     1.7 +- (id)initInternal;
     1.8 +
     1.9  @end
    1.10  
    1.11  #endif /* PEPSession_internal_h */
     2.1 --- a/pEpObjCAdapter/PEPSession.m	Fri Oct 06 09:52:54 2017 +0200
     2.2 +++ b/pEpObjCAdapter/PEPSession.m	Fri Oct 06 12:11:30 2017 +0200
     2.3 @@ -28,6 +28,13 @@
     2.4  
     2.5  - (id)init
     2.6  {
     2.7 +    //"Denied access to assure clients do not call [PEPSession new] accidentally. Use initInternal instead.
     2.8 +    NSAssert(false, @"Dear client. You must not init a session. Use [PEPObjCAdapter session] instead");
     2.9 +    return nil;
    2.10 +}
    2.11 +
    2.12 +- (id)initInternal
    2.13 +{
    2.14      [PEPSession setupTrustWordsDB];
    2.15  
    2.16      [[PEPObjCAdapter initLock] lock];