Objective C MCQ Questions and Answers
Objective C MCQ Questions and Answers
A.iOS 6.0
B.iOS 7.0
C.iOS 8.0 (Correct)
D.None of the above
2.Interface declares the behavior of class and implementation defines the behavior of
class.
A.True (Correct)
B.False
3.You could add a category to the NSString class, for example, to extend its
functionality.
A.True (Correct)
B.False
4.Informal protocols are typically declared as categories of the NSObject class.
A.True (Correct)
B.False
5.A category can be used to add new instance variables to a class.
A.True
B.False (Correct)
6.The line id <Painting> myObject;
A.Says that myObject is part of the Painting category
B.Says that myObject conforms to the Painting category
C.Says that myObject conforms to the Painting protocol (Correct)
D.Is not valid Objective-C syntax
7.The conformsToProtocol: method can be used to see if an object belongs to a class
that implements a particular protocol
A.True (Correct)
B.False
8.A category can be used to override other methods in the class, but it's not considered
good programming practice.
A.True (Correct)
B.False
9.The following
@interface GObj: NSObject <Painting>
Stmt2. HTTP URLs starts with http:// and use port 443 by default, while HTTPS URLs
starts with https:// and use port 80.
A.Both are correct
B.Both are wrong
C.Stmt1 is correct and Stmt2 is wrong.(Correct)
D.Stmt1 is wrong and Stmt2 is correct.
16.Does Objective-C contain private methods?
A.Yes
B.No (Correct)
17.Objective-C uses ____ datatype for dynamic typing.
A.var
B.id (Correct)
C.let
D.object
18.Is a delegate retained?
A.Yes
B.No (Correct)
19.How many bytes we can send to apple push notification server.
A.128 mb
B.128 bytes
C.256 mb
D.256 bytes
20.Retain,creates a reference from one object to another without increasing the
sources retain count.
A.True
B.False (Correct)
21.Which of above will create a circle of view with width 120 and height 150
A.view.layer.cornerRadius = 50;
B.view.layer.cornerRadius = 30;
C.view.layer.cornerRadius = 70;
D.We cannot create circle for this view. (Correct)
22.All Objects in Objective-C are created on
A.Stack
B.Heap (correct)
C.None of the above
23.Property attribute that synthesise only a getter for the property
A.atomic
B.nonatomic
C.readonly (Correct)
D.dynamic
24.Properties are nonatomic by default
A.True
B.False(Correct)
25.
Stmt1 : @property : It will generate getter and setter methods for property.
Stmt2 : @Synthesize :It will specify the property for all objects.
A.Both are correct
B.Both are wrong (Correct)
C.Stmt1 is correct and Stmt2 is wrong.
D.Stmt1 is wrong and Stmt2 is correct.
26.Which of the following is not a delegate method of NSURLConnection
Stmt1.(void)connection:(NSURLConnection
*)connection
didFailWithError:(NSError
*)error;
Stmt2.(void)connection:(NSURLConnection*)connection
didReceiveResponse:
(NSURLResponse *)response;
Stmt3.(void)connection:(NSURLConnection
*)connection
didReceiveData:(NSData
*)data;
Stmt4.(void)connectionDidFinishLoading:(NSURLConnection *)connection;
Stmt5.(void)connection:(NSURLConnection*)connection withRequest:(NSURLRequest
*)request;
A.All are delegate methods for NSURLConnection
B.None of the above are delegate methods for NSURLConnection
C.Only 2,4 are not delegate methods for NSURLConnection
D Stmt 5 is not delegate method (Correct)
27.Frameworks that make Cocoa.
A.Appkit and Foundation (Correct)
B.UIKit and Foundation
28.Objective-C also does not allow stack based objects.
A.True (Correct)
B.False
29.Notification and Observers both are same.
A.True
B.False (Correct)
30.Which of the following statements are correct for Plist file.
Stmt1. Plist files are xml files.(Correct)
Stmt2. Plist files are json files.
Stm3. Plist files are plain text files
Stmt4. Plist files are encrypted files.