From 1b18cb5df83eda129fba6c23bed955d9e4a2bbf8 Mon Sep 17 00:00:00 2001 From: Nikolay Morev Date: Tue, 9 Feb 2016 16:40:09 +0300 Subject: Mark non-designated initializers and new as unavailable --- src/objc/abstract/MCOAbstractMessage.h | 4 ++++ src/objc/abstract/MCOAbstractPart.h | 2 ++ src/objc/provider/MCOMailProvider.h | 2 ++ src/objc/provider/MCONetService.h | 2 ++ src/objc/utils/MCOOperation.h | 3 +++ 5 files changed, 13 insertions(+) (limited to 'src/objc') diff --git a/src/objc/abstract/MCOAbstractMessage.h b/src/objc/abstract/MCOAbstractMessage.h index ed858808..bc9b26f7 100644 --- a/src/objc/abstract/MCOAbstractMessage.h +++ b/src/objc/abstract/MCOAbstractMessage.h @@ -25,6 +25,10 @@ namespace mailcore { #ifdef __cplusplus - (instancetype) initWithMCMessage:(mailcore::AbstractMessage *)message NS_DESIGNATED_INITIALIZER; +/** Do not invoke this directly. */ +- (instancetype) init NS_UNAVAILABLE; +/** Do not invoke this directly. */ ++ (instancetype) new NS_UNAVAILABLE; #endif /** Header of the message. */ diff --git a/src/objc/abstract/MCOAbstractPart.h b/src/objc/abstract/MCOAbstractPart.h index 0e768215..8bff41dd 100644 --- a/src/objc/abstract/MCOAbstractPart.h +++ b/src/objc/abstract/MCOAbstractPart.h @@ -113,6 +113,8 @@ namespace mailcore { /** Do not invoke this directly. */ - (instancetype) init NS_UNAVAILABLE; +/** Do not invoke this directly. */ ++ (instancetype) new NS_UNAVAILABLE; @end diff --git a/src/objc/provider/MCOMailProvider.h b/src/objc/provider/MCOMailProvider.h index f2deff4e..513d568e 100644 --- a/src/objc/provider/MCOMailProvider.h +++ b/src/objc/provider/MCOMailProvider.h @@ -89,5 +89,7 @@ /** Do not invoke this directly. */ - (instancetype) init NS_UNAVAILABLE; +/** Do not invoke this directly. */ ++ (instancetype) new NS_UNAVAILABLE; @end diff --git a/src/objc/provider/MCONetService.h b/src/objc/provider/MCONetService.h index f186e811..0d707152 100644 --- a/src/objc/provider/MCONetService.h +++ b/src/objc/provider/MCONetService.h @@ -44,5 +44,7 @@ /** Do not invoke this directly. */ - (instancetype) init NS_UNAVAILABLE; +/** Do not invoke this directly. */ ++ (instancetype) new NS_UNAVAILABLE; @end diff --git a/src/objc/utils/MCOOperation.h b/src/objc/utils/MCOOperation.h index 7e37ce34..65f77681 100644 --- a/src/objc/utils/MCOOperation.h +++ b/src/objc/utils/MCOOperation.h @@ -40,7 +40,10 @@ @interface MCOOperation (MCOUnavailable) +/** Do not invoke this directly. */ - (instancetype) init NS_UNAVAILABLE; +/** Do not invoke this directly. */ ++ (instancetype) new NS_UNAVAILABLE; @end -- cgit v1.2.3 From ce8273bb3dc25d87349505645db65996c3ca753a Mon Sep 17 00:00:00 2001 From: Nikolay Morev Date: Tue, 9 Feb 2016 19:21:53 +0300 Subject: Don't mark MCOAbstractMessage init as unavailable It's used in subclass and there's no way to reenable previously disabled method in subclass. --- src/objc/abstract/MCOAbstractMessage.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/objc') diff --git a/src/objc/abstract/MCOAbstractMessage.h b/src/objc/abstract/MCOAbstractMessage.h index bc9b26f7..ed858808 100644 --- a/src/objc/abstract/MCOAbstractMessage.h +++ b/src/objc/abstract/MCOAbstractMessage.h @@ -25,10 +25,6 @@ namespace mailcore { #ifdef __cplusplus - (instancetype) initWithMCMessage:(mailcore::AbstractMessage *)message NS_DESIGNATED_INITIALIZER; -/** Do not invoke this directly. */ -- (instancetype) init NS_UNAVAILABLE; -/** Do not invoke this directly. */ -+ (instancetype) new NS_UNAVAILABLE; #endif /** Header of the message. */ -- cgit v1.2.3