Which of the following is NOT a root class in the context of Objective-C?

Which of the following values ​​is NOT a root class in the context of Objective-C?

a. NSObject

b. NSNetworkService

with. NSBase

D. NSProxy

(his one question of choice)

I get this question in an online exam for iOS 6. I know that NSObject and NSProxy are the root classes. But I do not know any class named NSNetworkService or NSBase .

I am wondering what is the correct answer to this question.

Note. I cleaned up this test and did not post this question for cheating.

+6
source share
2 answers

I do not know the NSNetworkService and NSBase (of course, someone could call their class the NS prefix). NSObject and NSProxy are base classes. Therefore, the correct answer is b and c .

Edit (thanks Abizern): In the context of iOS, only NSObject is available, which will add the answer d to the NOT class set, which is the root class. I think the opposite question is: "Which of the following classes are root classes?" it would be easier to answer, given the fact that you said that you can only choose one option;)

+3
source

see in the following link

1) NSObject is the root class of most hierarchical classes of Objective-C classes; he does not have a superclass.

2) Cocoa provides two root classes: NSObject and NSProxy . Cocoa defines the last class, an abstract superclass, for objects that act as stand-ins for other objects; therefore, NSProxy is important in the architecture of distributed objects. Because of this specialized role, NSProxy appears infrequently in Cocoa programs. When Cocoa developers refer to a root or base class, they almost always mean NSObject .

http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/CocoaObjects.html#//apple_ref/doc/uid/TP40002974-CH4-SW35

Edit

see this link http://samplecodebank.blogspot.in/2013/06/NSNetService-getInputStream-example.html

but there is no description of NSBase in google or SO

So the answer is c. NSBase c. NSBase

0
source

Source: https://habr.com/ru/post/948135/


All Articles