I am new to Objective-C; I wanted to understand the concept more clearly protocol.
protocol
@protocol protocolName @optional @required @end
Is it possible to map a part @optionalto a part of a virtual function and @requiredusing a pure virtual function in C ++?
@optional
@required
Is @protocolObjective-C a way to create an interface and an abstract class ?
@protocol
Is @protocol an Objective-C way to create an interface and abstract class?
That's right.
@optional @required ++?
, , - classA OptionProtocolMethodB, [classA OptionalProtocolMethodB] . ++ .
, . :
if ([_delegate respondsToSelector:@selector(didUploadedTotalBytes: totalBytesExpectedToWrite:)]) { [_delegate didUploadedTotalBytes:_uploadedBytes totalBytesExpectedToWrite:_totalBytes]; }
Objective-C ( ). .
, . , : "color" "setColor", , . , , - . , , - .
, , . , , BOOL, : " , , YES". , . , "responsesToSelector". (, , , requireComplexBehaviour YES, doComplexBehaviour1 doComplexThings2 , , , ).
. , , , , .
Source: https://habr.com/ru/post/1536141/More articles:Dynamic mapping and sharing with Grunt Uglify - gruntjshow much sklearn can i use with pypy? - numpyGetting xml element name from unmarshalled java object using JAXB - javaWhy does c_str () return the same value for two different lines? - c ++CocoaPods not working - iosTypescript 1.0 map files not loading - visual-studio-2013memory section overflow detection in ld - gccIs there a way to detect application settings changes? - c #Create pdf using jsPDF with formatted table data - jqueryHow to convert HTML to pdf in angular2? - angularAll Articles