Correct Answer:
Nothing is wrong with it.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Atomic
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The parameter is passed by reference and may be changed
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Property getter/setter
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Arrays are ordered, non-unique values.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A block of code
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
To extend other classes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UserDefaults
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
There is no base type.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Fields
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It is static
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Single inheritance but multiple protocol implementation
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Automatic Reference Counting
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Nothing is wrong with this code.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A function with a return type of float.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSMutableDictionary's values can change
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Atomic/strong
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
CoreData framework
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UIWebView
Note: This Question is unanswered, help us to find answer for this one
What will be printed on screen after running the following code?
int main()
{
int a = 5;
float c = .5f
printf("%.2f", a / c);
return 0;
}
Correct Answer:
Nothing: you will get a compile-time error
10.0
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UITextView >> UIScrollView >> UIView >> UIResponder >> NSObject
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
“userInfo”
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
“@throw” statement
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UIViewAnimationOptionCurveEaseIn
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSMutableArray
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
nonatomic
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Calling “alloc” increases the references count by +1
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
“domain”
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
opacity
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Releasing ownership on all of the owned properties and calling “[super dealloc];”
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@optional -(NSString)someMethod;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@interface UIColor (MyCategory)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
“Cascade”
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
“@catch” block
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
There is no way to define a class function in protocol
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSGeneticException
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
compile-time error
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
#import “Header.h”
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Automatic Reference Counting
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
“assign” property attribute stores a direct pointer without any “retain” / “release” calls
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
All of the above
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSMutableDictionary
dealloc
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Using object-oriented programming the object that sends a message
Correct Answer:
id
Note: This Question is unanswered, help us to find answer for this one
All of the methods in a (...) annotated with @required must be implemented.
Correct Answer:
protocol
Note: This Question is unanswered, help us to find answer for this one
When an object's retainCount reaches 0, which message is automatically sent to that Object?
Correct Answer:
dealloc
Note: This Question is unanswered, help us to find answer for this one
Considering the following Objective-c snippet, which of the following is NOT correct ?
#import <Foundation/Foundation.h> @interface SampleClass:NSObject - (void)sampleMethod; @end @implementation SampleClass - (void)sampleMethod{ NSLog(@"Hello, World! \n"); } @end int main() { /* my first program in Objective-C */ SampleClass *sampleClass = [[SampleClass alloc]init]; [sampleClass sampleMethod]; return 0; }
Correct Answer:
`@end` marks the end of the class
Note: This Question is unanswered, help us to find answer for this one
Considering the following Objective-C code, which of the following statements is correct ?
// function declaration intfunc(); int main() { // function call inti = func(); } // function definition intfunc() { return 0; }
Correct Answer:
The code won't run because the `func()` was not defined at the time of the call.
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a correct sample of block implementation in Objective-C?
Correct Answer:
`void (^simpleBlock)(void) = ^{NSLog(@"This is a block");};`
Note: This Question is unanswered, help us to find answer for this one
It's possible to add a (...) to the standard NSString class, for example, to extend its functionality.
Correct Answer:
category
Note: This Question is unanswered, help us to find answer for this one
Which of the following is NOT correct to state about Objective-C language ?
Correct Answer:
It's an interpreted programming language designed for object orientation
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, if I call performSelector:withObject:afterDelay: – is the object retained ?
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Considering best practices of memory management in Objective-C, is it correct to say that the delegate is never retained ?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
#import <Foundation/Foundation.h>int main() { inti = 17; char c = 'c'; /* ascii value is 99 */ int sum; sum = i + c; NSLog(@"sum : %d\n", sum ); return 0; }
When the above code is compiled and executed, it produces the following result:
Correct Answer:
sum : 116
Note: This Question is unanswered, help us to find answer for this one
The following Objective-C code defines
... @interface Fraction (MathOps) ... @end
Correct Answer:
a category called MathOps
Note: This Question is unanswered, help us to find answer for this one
In which of the following situations you would NOT use void types?
Correct Answer:
To define functions which do not return value
Note: This Question is unanswered, help us to find answer for this one
Which of the following is NOT correct about Protocols ?
Correct Answer:
A single class cannot conform to multiple protocols.
Note: This Question is unanswered, help us to find answer for this one
The Objective-C code ... @interface MyClass : NSObject<Sample> ... @end
Correct Answer:
Indicates MyClass conforms to the Sample protocol
Note: This Question is unanswered, help us to find answer for this one
Considering the following Objective-C code, what will get printed:
#import <Foundation/Foundation.h>int main()
{ int sum = 17, count = 5; CGFloat mean; mean = (CGFloat) sum / count; NSLog(@"mean : %f", mean ); return 0; }
Correct Answer:
mean : 3.400000
Note: This Question is unanswered, help us to find answer for this one
Consider below declaration of Song object and tell proper way to call name property?
import @interface Song:NSObject { NSString *name; NSString *artist; } (NSString *) name; (NSString *) artist; @ end
Correct Answer:
mySong->name;
[mySong, name];
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is the best way to convert NSNumber into NSString?
Correct Answer:
NSString *string = [NSNumberstringValue];
Note: This Question is unanswered, help us to find answer for this one
Name a property attribute that synthesizes accessors that are not thread safe?
Correct Answer:
nonatomic
Note: This Question is unanswered, help us to find answer for this one
Where does Objective C store objects, Heap or stack?
Correct Answer:
Heap
Note: This Question is unanswered, help us to find answer for this one
Look at below code and tell correct output?
import static int count; intcnt; for (inti = 0; i<100; i++) { count++; cnt++; } NSLog(@"count=%d cnt=%d\n", count, cnt);
Correct Answer:
count=100 cnt=100
Note: This Question is unanswered, help us to find answer for this one
What is a local variable that has no default initial value and does not retain its value through method calls?
Correct Answer:
A static variable
Note: This Question is unanswered, help us to find answer for this one
Can you call C++ code from the Objective-C environment?
Correct Answer:
Yes, from any .mm file
Note: This Question is unanswered, help us to find answer for this one
Which of the following is a Singleton?
Correct Answer:
[NSFileManager* objects]
Note: This Question is unanswered, help us to find answer for this one
Look at below code and provide the reference counter value after it executes:
Object *anObj = [[Object alloc] init]; [anObj retain]; [anObj release]; [anObj release];
Correct Answer:
Reference counter will be 0, anObj will be deallocated automatically
Note: This Question is unanswered, help us to find answer for this one
What will be the output of following code?
BOOL isBool = YES; NSLog(@"%d", isBool);
Correct Answer:
1
Note: This Question is unanswered, help us to find answer for this one
Please pick the most suitable difference between alloc and dealloc?
Correct Answer:
alloc creates a new instance and make the reference counter as 1, dealloc will remove the instance automatically when its reference counter become 0
Note: This Question is unanswered, help us to find answer for this one
An object id with a value of 0?
Correct Answer:
nil
Note: This Question is unanswered, help us to find answer for this one
How do you search an object in an object array?
Correct Answer:
NSEnumerator *enumerator = [array objectEnumerator]; while([enumerator nextObject]){…}
Note: This Question is unanswered, help us to find answer for this one
Property attribute that synthesizes only a getter for the property?
Correct Answer:
readonly
Note: This Question is unanswered, help us to find answer for this one
Which is the most proper answer to load plist file contents into an array?
Correct Answer:
NSArray * array = [[NSArrayalloc] initWithContentsOfFile:plistfile_path];
Note: This Question is unanswered, help us to find answer for this one
Which of the following contain an INCORRECT way to declare and initialize an array ?
Correct Answer:
`double balance = {1000.0, 2.0, 3.4, 17.0, 50.0}; `
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, sometime, you may find that you wish to extend an existing class by adding behavior that is useful only in certain situations. In order to add such extension to existing classes, Objective-C provides ...
Correct Answer:
categories and extensions
Note: This Question is unanswered, help us to find answer for this one
The (...) is an Objective-C directive, which is also used to define the aliases for various data types similar to (...). But (...) is limited to giving symbolic names to types only, whereas (...) can be used to define alias for values as well, like you can define 1 as ONE, etc.
Correct Answer:
#define, typedef, typedef, #define
Note: This Question is unanswered, help us to find answer for this one
Which of the following contain an INCORRECT concept regarding Objective-C programming ?
Correct Answer:
None of the above
Note: This Question is unanswered, help us to find answer for this one
Memory management is one of the most important processes in any programming language. It is the process by which the memory of objects are allocated when they are required and deallocated when they are no longer required. Objective-C Memory management techniques can be broadly classified into two types: "Manual Retain-Release" or MRR and "Automatic Reference Counting" or ARC. Which of the following is NOT correct regarding memory management in Objective-C ?
Correct Answer:
In MRR, when we no longer need an object, we must relinquish the ownership by sending it a release message; the autorelease message tough can only be sent in ARC contexts.
Note: This Question is unanswered, help us to find answer for this one
Memory management is one of the most important processes in any programming language. It is the process by which the memory of objects are allocated when they are required and deallocated when they are no longer required. In (...), when we no longer need it, we must relinquish ownership of an object we own: We relinquish ownership of an object by sending it a release message or an autorelease message. In Cocoa terminology, relinquishing ownership of an object is therefore typically referred to as "releasing" an object.
Correct Answer:
ARC
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, retain counts are the way in which memory is managed. When you create an object, it has a retain count of (...). When you send an object a retain message, its retain count is incremented by (...). When you send an object a release message, its retain count is decremented by (...). When you send an object a autorelease message, its retain count is decremented by (...) at some stage in the future. If an objectʼs retain count is reduced to (...), it is deallocated.
Correct Answer:
1, 1, 1, 1, 0
Note: This Question is unanswered, help us to find answer for this one
Objective-C allows you to define protocols, which declare the methods expected to be used for a particular situation. Protocols are implemented in the classes conforming to the protocol. The methods under keyword (...) must be implemented in the classes that conform to the protocol and the methods under (...) keyword are optional to implement.
Correct Answer:
@required, @optional
Note: This Question is unanswered, help us to find answer for this one
In the real world, people on official business are often required to follow strict procedures when dealing with certain situations. In the world of object-oriented programming, it’s important to be able to define a set of behaviors that is expected of an object in a given situation. As an example, a table view expects to be able to communicate with a data source object in order to find out what it is required to display. This means that the data source must respond to a specific set of messages that the table view might send. The data source could be an instance of any class, such as a view controller or a dedicated data source class that perhaps just inherits from NSObject. In order for the table view to know whether an object is suitable as a data source, it’s important to be able to declare that the object implements the necessary methods. The description above is essentially related to which feature of Objective-C programming language ?
Correct Answer:
Protocols
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the base class of all objects in Objective-c ?
Correct Answer:
NSObject
Note: This Question is unanswered, help us to find answer for this one
Objective-C provides a range of methods to work with NSNumber. Which of the following methods creates and returns an NSNumber object containing a given value, treating it as an NSInteger.
Correct Answer:
`+ (NSNumber *)numberWithInteger:(NSInteger)value `
Note: This Question is unanswered, help us to find answer for this one
While calling a function by reference, it will copy the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument. Is the statement above True ?
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the (...) programming language. This is the main programming language used by Apple for the OS X and iOS operating systems and their respective APIs, Cocoa and Cocoa Touch.
Correct Answer:
C
Note: This Question is unanswered, help us to find answer for this one
What happens when the following code executes?
Ball *ball = [[[[Ball alloc] init] autorelease] autorelease];
Correct Answer:
It will crash
Note: This Question is unanswered, help us to find answer for this one
Which of the following is correct (legal) floating-point literal ?
Correct Answer:
314159E-5L
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, a derived class can access all the private members of its base class if it's defined in the interface class, but it cannot access private members that are defined in the implementation file. Is the statement above correct ?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, retain counts are the way in which memory is managed in Objective-C. When you create an object, it has a retain count of 1. When you send an object a (...) message, its retain count is incremented by 1. When you send an object a (...) message, its retain count is decremented by 1.
Correct Answer:
retain, release
Note: This Question is unanswered, help us to find answer for this one
The (...) method can be used to see if an object belongs to a class that implements a particular protocol.
Correct Answer:
conformsToProtocol:
Note: This Question is unanswered, help us to find answer for this one
(...) is an abstractClass which represents a stream of data. They are used in Archiving and Unarchiving objects. (...) objects are usually used in a method that is being implemented so that the class conforms to the protocol.
Correct Answer:
NSCoder
Note: This Question is unanswered, help us to find answer for this one
In Objective-C programming, error handling is provided with (...) class available in Foundation framework. An (...) object encapsulates richer and more extensible error information than is possible using only an error code or error string. The core attributes of an (...) object are an error domain (represented by a string), a domain-specific error code and a user info dictionary containing application specific information.
Correct Answer:
NSError
Note: This Question is unanswered, help us to find answer for this one
Two distinct types of problems can arise while an iOS or OS X application is running. Exceptions represent programmer-level bugs like trying to access an array element that doesn’t exist. They are designed to inform the developer that an unexpected condition occurred. Since they usually result in the program crashing, exceptions should rarely occur in your production code. On the other hand, errors are user-level issues like trying load a file that doesn’t exist. Because errors are expected during the normal execution of a program, you should manually check for these kinds of conditions and inform the user when they occur. Most of the time, they should not cause your application to crash. Is the statement above correct ?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, Exceptions can be handled using the standard a common pattern found in most other high-level programming languages. First, you need to place any code that might result in an exception in an (...) block. Then, if an exception is thrown, the corresponding (...) block is executed to handle the problem. The (...) block is called afterwards, regardless of whether or not an exception occurred.
Correct Answer:
`@try, @catch(), @finally`
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not a property of NSError class?
Correct Answer:
reason
Note: This Question is unanswered, help us to find answer for this one
In Objective-C, a category is a group of related methods for a class, and all of the methods defined in a category are available through the class as if they were defined in the main interface file. Instead of the normal @interface declaration, we include the category name in (...) after the class name we're extending.
Correct Answer:
`()`
Note: This Question is unanswered, help us to find answer for this one
If you start a class definition that conforms to a specified (...), you will not need to relist all the methods you will implement for that protocol in the @interface section.
Correct Answer:
protocol
Note: This Question is unanswered, help us to find answer for this one
(...) are used by Cocoa and Cocoa Touch objects for a variety of different situations. For example, the table view classes (NSTableView for OS X and UITableView for iOS) both use a data source object to supply them with the necessary information. Both define their own data source (...); both table view classes also allow you to set a delegate object, which again must conform to the relevant NSTableViewDelegate or UITableViewDelegate (...). The delegate is responsible for dealing with user interactions, or customizing the display of certain entries.
Correct Answer:
Protocol
Note: This Question is unanswered, help us to find answer for this one
What's the hierarchy of UIButton until NSObject ?
Correct Answer:
UIButton >> UIControl >> UIView >> UIResponder >> NSObject
Note: This Question is unanswered, help us to find answer for this one
Which of the following contains the INCORRECT definition of a Predefined Macro ?
Correct Answer:
`__STDC__`: This contains the current line number as a decimal constant.
Note: This Question is unanswered, help us to find answer for this one
In (...), the system uses the same reference counting system as (...), but it inserts the appropriate memory management method calls for us at compile-time.
Correct Answer:
ARC, MRR
Note: This Question is unanswered, help us to find answer for this one
Which of the following contains the INCORRECT definition of a preprocessor directive ?
Correct Answer:
`#error`: Issues special commands to the compiler using a standardized method
Note: This Question is unanswered, help us to find answer for this one
While calling a function by reference, it will copy the address of an argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. This means that changes made to the parameter affect the argument. Is the statement above True ?
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
Which of the following contains the INCORRECT definition of a bitwise operator ?
Correct Answer:
`^`: Binary Ones Complement Operator is unary and has the effect of 'flipping' bits.
Note: This Question is unanswered, help us to find answer for this one
What is category in Objective-C?
Correct Answer:
Category is used to define additional methods of an existing class
Note: This Question is unanswered, help us to find answer for this one
What is the difference between #import and #include?
Correct Answer:
The #include allows you to include the same file many times while #import ensures that the preprocessor only includes a file once
Note: This Question is unanswered, help us to find answer for this one
Where is a MKAnnotationView used?
Correct Answer:
On a Map View
Note: This Question is unanswered, help us to find answer for this one
Which is the most proper answer about the difference between nil and NULL?
Correct Answer:
nil is an object that can receive messages but NULL is a constant
Note: This Question is unanswered, help us to find answer for this one
The property attribute that causes the setter to store a strong reference to the assigned value is called:
Correct Answer:
Strong
Note: This Question is unanswered, help us to find answer for this one
The part of an Objective-C class specification that declares its public interface which includes its superclass name & instances variables and public-method prototypes is called:
Correct Answer:
interface
Note: This Question is unanswered, help us to find answer for this one
What is the difference between the unsigned int and the NSUInteger?
Correct Answer:
NSUInteger is an Objective-C class
Note: This Question is unanswered, help us to find answer for this one
Look at below code and tell which is correct.
(id) init { if ( self == [super init] ) { [self setCaption:@"Default Caption"]; } return self; }
Correct Answer:
No problem, everything is correct
Note: This Question is unanswered, help us to find answer for this one
Look at below code and tell what the problem could be:
NSNumber value1 = [[NSNumberalloc] initWithFloat:8.15]; NSNumber value2 = [NSNumber numberWithFloat:8.29]; … … … [value1 release]; [value2 release];
Correct Answer:
Value1 and value2 should be initialized after allocating
Note: This Question is unanswered, help us to find answer for this one
What is the name of the root class in Objective-C?
Correct Answer:
NSObject
Note: This Question is unanswered, help us to find answer for this one
Two additional foundational building blocks of Objective-C distinct from data and procedure type foundations: _____ and Categories/Extensions?
Correct Answer:
Protocols
Note: This Question is unanswered, help us to find answer for this one
What is a class object?
Correct Answer:
Class Object is an implementation of a Class that has method and property
Note: This Question is unanswered, help us to find answer for this one
How do you free an object?
Correct Answer:
[obj release]
Note: This Question is unanswered, help us to find answer for this one
What is the difference between the unsigned int and the NSUInteger?
Correct Answer:
It depends on the processor
Note: This Question is unanswered, help us to find answer for this one
What can you do with categories?
Correct Answer:
Add methods to a class without subclassing it
Override methods of a class without subclassing it
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What can be linked to an Obj-C program without any particular process?
Correct Answer:
C libraries
C++ libraries
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is an IMP?
Correct Answer:
The C type of a method implementation pointe
Note: This Question is unanswered, help us to find answer for this one
Which of the following is incorrect?
Correct Answer:
[AClass release]
Note: This Question is unanswered, help us to find answer for this one
Protocols are like classes; they can inherit
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Which of the following declares a protocol?
Correct Answer:
@protocol ProtocolName
Note: This Question is unanswered, help us to find answer for this one
How do you include the root “Object” class?
Correct Answer:
It depends on the compiler
Note: This Question is unanswered, help us to find answer for this one
What is a protocol?
Correct Answer:
An interface without an implementation
Note: This Question is unanswered, help us to find answer for this one
What can be used as Object instance variables?
Correct Answer:
int
structures
pointers
unions
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is a @finally block?
Correct Answer:
A block of code that is run whenever an exception is thrown or not
Note: This Question is unanswered, help us to find answer for this one
How do you throw an exception?
Correct Answer:
@throw exception
Note: This Question is unanswered, help us to find answer for this one
What’s the difference between copy and deepCopy?
Correct Answer:
copy creates a copy at the first level, while deepcopy copies the instance variables
Note: This Question is unanswered, help us to find answer for this one
Can you send messages to nil?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
What is the isa variable in objects?
Correct Answer:
Object class identification
Note: This Question is unanswered, help us to find answer for this one
Which of the following does not happen when you throw an exception in a @synchronized block?
Correct Answer:
The object is deallocated
Note: This Question is unanswered, help us to find answer for this one
In which version of Objective-C did the properties system appear?
Correct Answer:
2.0
Note: This Question is unanswered, help us to find answer for this one
Which of the following is not recommended?
Correct Answer:
Using static variables inside methods
Note: This Question is unanswered, help us to find answer for this one
Which of the following can be inherited?
Correct Answer:
Categories
Protocols
Classes
Classes
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is an autoreleased object?
Correct Answer:
An object that will be released when the current AutoreleasePool is deallocated.
Note: This Question is unanswered, help us to find answer for this one
Can a method be declared to accept a variable number of arguments?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
What is the default visibility for instance variables?
Correct Answer:
@protected
Note: This Question is unanswered, help us to find answer for this one
Which of the following is false?
Correct Answer:
When a method is called, the send is automatically available as the sender variable, like
self or super
Note: This Question is unanswered, help us to find answer for this one
What are @try and @catch?
Correct Answer:
Exception keywords
Note: This Question is unanswered, help us to find answer for this one
What is not supported in Obj-C?
Correct Answer:
Method argument default value
Note: This Question is unanswered, help us to find answer for this one
Is the following code a correct allocation?
MyClass myObj;
[&myObj aMessage];
Correct Answer:
No
Note: This Question is unanswered, help us to find answer for this one
What comments are supported in Obj-C?
Correct Answer:
//Line comments
/* Block comments */
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is true regarding @public?
Correct Answer:
It breaks encapsulation
Note: This Question is unanswered, help us to find answer for this one
What does the following imply?
Worker *ceo = [[Worker alloc] init];
ceo->boss = nil;
Correct Answer:
That the ceo object is statically typed
That the boss instance variable is declared @public
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
A method can be tagged to be called only by a specific class and its subclasses.
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
When using the garbage collector, which method, that is normally called without the collector, is not called on your objects where they are collected?
Correct Answer:
dealloc
Note: This Question is unanswered, help us to find answer for this one
How do you allocate an object?
Correct Answer:
MyClass *obj = malloc(sizeof(MyClass));
MyClass *obj = malloc(sizeof(MyClass));
MyClass *obj = malloc(sizeof(MyClass));
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
What is true regarding @protected?
Correct Answer:
The instance variable is accessible within the class that declares it and within classes that
inherit it
Note: This Question is unanswered, help us to find answer for this one
What type of variable do you need to use to implement singletons?
Correct Answer:
static
Note: This Question is unanswered, help us to find answer for this one
Which C feature is not supported in Obj-C?
Correct Answer:
Support is compiler dependant
Note: This Question is unanswered, help us to find answer for this one
What is nil?
Correct Answer:
The null object
Note: This Question is unanswered, help us to find answer for this one
In Obj-C 2.0, what do the fast enumeration protocols rely on to provide fast Enumerations?
Correct Answer:
C arrays
Note: This Question is unanswered, help us to find answer for this one
What is true regarding strings?
Correct Answer:
C string literals can be used in Obj-C
Note: This Question is unanswered, help us to find answer for this one
In which version of Objective-C did the fast enumeration system appear?
Correct Answer:
2.0
Note: This Question is unanswered, help us to find answer for this one
A class can conform to only one protocol?
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
What is a category?
Correct Answer:
A category is a way to add methods to a class which already exists
Note: This Question is unanswered, help us to find answer for this one
What happens if you release an unretained object twice?
Correct Answer:
Undefined behaviour
Note: This Question is unanswered, help us to find answer for this one
What does Obj-C not support?
Correct Answer:
Class variables
Note: This Question is unanswered, help us to find answer for this one
Which of the following is the fastest?
Correct Answer:
Explicit locking
Note: This Question is unanswered, help us to find answer for this one
What is true regarding C functions inside .m files?
Correct Answer:
They can contain Obj-C code
They can be static
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
If you need to allocate custom memory, in which method will you do so?
Correct Answer:
–init
Note: This Question is unanswered, help us to find answer for this one
What is the Obj-C runtime?
Correct Answer:
A C library
Note: This Question is unanswered, help us to find answer for this one
What happens if two categories define methods with the same names for the same class?
Correct Answer:
At runtime, either method will be called
Note: This Question is unanswered, help us to find answer for this one
What is true regarding messaging?
Correct Answer:
Messaging is fully dynamic, which means you can compile some code that sends a
message to a class that doesn’t implement it, and add a category later, in a dynamic library
for example
Note: This Question is unanswered, help us to find answer for this one
A class can have two methods with the same name, but with different argument types?
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
What can you use to avoid the msgSend function overhead?
Correct Answer:
IMP
Note: This Question is unanswered, help us to find answer for this one
What is #import?
Correct Answer:
C preprocessor construct to avoid multiple inclusions of the same file
Note: This Question is unanswered, help us to find answer for this one
Which of the following creates a class that conforms to a protocol?
Correct Answer:
@interface ClassName [ProtocolName]
@interface ClassName [ProtocolName]
Note: This question has more than 1 correct answers
Note: This Question is unanswered, help us to find answer for this one
Can an exception caught in @catch be re-thrown?
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
What class specifiers are supported?
Correct Answer:
There is no such thing as class specifiers.
Note: This Question is unanswered, help us to find answer for this one
What will be the output of the following code?
static int
a (void)
{
printf ("a\n");
return 0;
}
static int
b (void)
{
printf ("b\n");
return 1;
}
static int
c (void)
{
printf ("c\n");
return 2;
}
int main (int argc, const char *argv[])
{
printf ("%d %d %d", a (), b (), c ());
return 0;
}
Correct Answer:
c
b a
0 1 2
Note: This Question is unanswered, help us to find answer for this one
What is a SEL?
Correct Answer:
The C type of a message selector
Note: This Question is unanswered, help us to find answer for this one
What is the id type?
Correct Answer:
A generic C type that Objective-C uses for an arbitrary object.
Note: This Question is unanswered, help us to find answer for this one
What is the C type used to work with objects in Obj-C?
Correct Answer:
pointer
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
1, 2
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Messaging is fully dynamic, which means you can compile some code that sends a message to a class that doesn't implement it, and add a category later, in a dynamic library for example
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Mutex implicit locking
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
To avoid memory presure when creating a lot of autoreleased object (for example in a loop)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@property(readwrite,retain,atomic)NSInteger value;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
IMP
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
At runtime, either method will be called
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Log doesn't print anything. It's a deadlock here because the main queue will block on the call to dispatch_sync
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UILabel
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
-dealloc
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
As a null terminated C string.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
nil is literal null value for Objective-C instances. NULL is literal null value for C pointers
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
FALSE
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Consumable In-App Purchases are not to be restored
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
-forwardInvocation:
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It will cause the string to be released twice with undefined consequences when the surrounding autorelease pool is emptied
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
We won't have persistent result
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSKeyedUnarchiver unarchiveObjectWithData:
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSStream
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
+ (void) initialize;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
+ (id) alloc;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
colorWithCIColor:
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
CIAdditionCompositing
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
CAAction
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Method argument default value
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSManagedObjectModel
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
For each iteration of the loop a new array is allocated and released.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It will overwrite the data past the size
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
tuple
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False (You should use CFHost)
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSString
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
[NSObject description]
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
instancetype
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Using the CATransaction class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Comparison and Compound
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
It represents an external file of persisted data
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
typedef NSString *(^aBlock)(NSArray *);
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
None, they perform the same actions.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
C and Smalltalk.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
You can create a retain cycle
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ // code });
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
po
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
id
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSManagedObject
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Log prints "(null)" and continues as usual.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSArray *array = @[@"One", @"Two", @"Three"];
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No, they are not objects at all.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSBlockOperation
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
No, you use init and dealloc on Objective-C
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
An Error during compile
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Yes
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
false
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
b.var;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Foundation
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
The root viewcontroller handles loading and unloading its child viewcontrollers.
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Make a category, e.g. @interface Bar(Foo).
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
CoreLocation
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
True
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSSortDescriptor
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
CTFontCopyCharacterSet
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
SQLite
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSNumber
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
On a Map View
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A delegate allows one NSObject to send messages to another NSObject, and listen to those messages
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Automatic Reference Counting
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
@"foo"
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Foo *temp = [[Foo alloc] init];
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
UIKit
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
[NSFileManager defaultManager]
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
baz = [foo stringByAppendingString: bar];
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
This is the general type for any kind of object regardless of class
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Interface builder
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
addObserver:forKeyPath:options:context
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
NSArray
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
[obj release]
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
- (IBAction) action:(id) sender;
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
You increase its retain count by 1
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
FALSE
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Instance methods begin with - class level methods begin with +
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
Recording information from a single process about memory allocation
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
A dependency is a way to have an operation wait to be performed until the dependencies have been fulfilled/executed
Note: This Question is unanswered, help us to find answer for this one
Correct Answer:
False
Note: This Question is unanswered, help us to find answer for this one
Objective C MCQs | Topic-wise