0% found this document useful (0 votes)
2K views

Objective C MCQ Questions and Answers

This document contains 30 multiple choice questions about iOS and Objective-C concepts such as the latest iOS version, categories, protocols, properties, memory management, and more. Key topics covered include categories and protocols, properties, memory management, delegates, frameworks that compose Cocoa, and plist files. The questions test understanding of fundamental Objective-C language features and iOS frameworks.

Uploaded by

harsh5991
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views

Objective C MCQ Questions and Answers

This document contains 30 multiple choice questions about iOS and Objective-C concepts such as the latest iOS version, categories, protocols, properties, memory management, and more. Key topics covered include categories and protocols, properties, memory management, delegates, frameworks that compose Cocoa, and plist files. The questions test understanding of fundamental Objective-C language features and iOS frameworks.

Uploaded by

harsh5991
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

1.What is latest iOS version?

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>

A.Starts the definition of a Painting category


B.Starts the definition of a Painting protocol
C.Painting protocol
D.Starts the definition of a class called GObj that conforms to the (Correct)
E.None of the above
10.The following:
@interface Fraction (MathOps)
...
@end
A.Defines a category called MathOps (Correct)
B.Defines a protocol called MathOps
11.If you start a class definition that conforms to a specified protocol, you need to relist
all the methods you will implement for that protocol in the @interface section.
A.True
B.False (Correct)
12.All of the methods in a category must be implemented
A.True
B.False (Correct)
13.A category can be a good way to divide the implementation of a class into logical
sections
A.True (Correct)
B.False
14.#import and @class filename
Stmt 1.#import brings the entire header file in question into the current file; any files that
that file #imports are also included.
Stmt 2.@class just tells the compiler,it's a class.
A.Both are correct (Correct)
B.Both are wrong
C.Stmt1 is correct and Stmt2 is wrong.
D.Stmt1 is wrong and Stmt2 is correct.
15.HTTP and HTTPS.
Stmt1. HTTP transmits everything as plain text, while HTTPS provides encrypted

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.

You might also like