Object-C

확장자

.m : c

.mm : c++

 

헤더 포함

#import "header.h"

 

class

선언

@interface와 @end 사이에 선언

Method

+ : static

- : 일반

+|- (returnType)methodName:(param1Type)param1 param2TypeName:(param2Type)param2

+ (NSString *)analyze:(UIImage *)image info:(NativeResult *)nativeResult;

Property

@property(nonatomic,  strong ) UIImage *image; 

 

구현

@implementation와 @end 사이에 구현

 

Method 호출

+ : [ ClassName MethodName : param1 param2TypeName:param2 ]

- :  [ InstanceName MethodName : param1 param2TypeName:param2 ]

 

샘플

@interface NativeResult : NSObject
+ (NSString *)analyze:(UIImage *)image info:(NativeResult *)nativeResult;

@property(nonatomic,  strong ) UIImage *analyzedImage;

@end

 

@implementation NativeResult 

+ (NSString *)analyze:(UIImage *)image info:(NativeResult *)nativeResult{

            return [NSString stringWithUTF8String:"testresult String];

}

@end

 

NativeResult::analyze()호출

[ NativeResult analyze: image info:nativeResult]

 

 

https://asfirstalways.tistory.com/281

'IOS' 카테고리의 다른 글

Object-C  (0) 2020.07.09

+ Recent posts