You are on page 1of 2

IOS Fresher Questions

Q: How would you create your own custom view?

A: By Subclassing the UIView class.

Q: Whats the difference between  NSArray and  NSMutableArray?

A: NSArrayʼs contents can not be modified once itʼs been created whereas a
NSMutableArray can be modified as needed, i.e items can be added/removed from it.

Q: Explain retain counts.

A: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 retain
message, its retain count is incremented by 1. When you send an object a release
message, its retain count is decremented by 1. When you send an object a
autorelease message, its retain count is decremented by 1 at some stage in the
future. If an objectʼs retain count is reduced to 0, it is deallocated.

Q: Whats the difference between frame and bounds?

A: The frame of a view is the rectangle, expressed as a location (x,y) and size
(width,height) relative to the superview it is contained within. The bounds of a view is

the rectangle, expressed as a location (x,y) and size (width,height) relative to its
own coordinate system (0,0).

Q: Is a delegate retained?

A:No, the delegate is never retained! Ever!

Q:Outline the class hierarchy for a UIButton until NSObject.


A: UIButton inherits from UIControl, UIControl inherits from UIView, UIView inherits from

UIResponder, UIResponder inherits from the root class NSObject.

Q. Ns object is parent class or derived class?

Ans: Ns object is parent class and contains a number of instance variables and instance
methods

Q: Is a delegate retained?

Ans: No, the delegate is never retained! Ever!

Q: Difference between Shallow copy and Deep copy?

Ans: Shallow copy is also known as address copy.In this process you only copy address
not actual data. While in Deep copy you copy data.

Q. which xml parser we use on iphone?

Ans: “NSXML” Parser.

You might also like