문제

I'm learning iOS development right now and I came across concrete and abstract class. What are the difference between these class. I've searched online but they're in other languages not in Objective-C.

도움이 되었습니까?

해결책

There is nothing to stop a person from instantiating a abstract class. There is no distinction between concrete and abstract classes.

A concrete class is one that is actually used "as is" for some purpose. A abstract class is a class that is subclassed but has little functionality on it's own. Example NSObject is a abstract class(never use it as is). UIActivityIndicator is a concrete class(pretty much always use it as is).

The only difference is that concrete classes are ready out of the box, and abstract classes are meant to be subclassed class.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top