Tuesday 3 November 2015

iOS InterView Quetions 1

1) How would you create your own custom view?
   Subclass the UIView class. 
 
2) What is fast enumeration?
Fast enumeration is a language feature that allows you to enumerate over the contents of a collection. (Your code will also run faster because the internal implementation reduces message send overhead and increases pipelining potential.) 

3)Explain retain counts.
Retain counts is 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.


4)What’s the difference between frame and bounds?
 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).

 
 5)Explain the difference between NSOperationQueue concurrent and non-concurrent.
In the context of an NSOperation object, which runs in an NSOperationQueue, the terms concurrent and non-concurrent do not necessarily refer to the side-by-side execution of threads. Instead, a non-concurrent operation is one that executes using the environment that is provided for it while a concurrent operation is responsible for setting up its own execution environment. 


6)What is protocol? Types off protocols?
    List of methods that share among the class.
Types of protocols
          1- formal
Formal protocols are those protocols that are implemented using Objective protocols:
@protocol NSFoo <NSSomeProtocol>
-(int) doesIt;
@end

         2- informal
                 Informal protocols are defined as categories on NSObject with no implementation:
@interface NSObject(FooDelegate)
- (void)optionalFooDelegateMethod;
                       @end

 
7)How many layers are there in iphone sdk?
        1) cocoa touch layer
                Address book UI
                UIkit
        2) media layer
                .audio toolbox
                .audio unit
                .AV foundation
                .core Audio
                .core graphics
                .media player
                .open GL ES
                .quartz Core
        3) core service layer
                .address book
                .core foundation
                .core location    
                .foundation       
                .system Configuration
        4) core OS layer
                .CF network      
                .security
                .system

8) What is the IB?
        It design app user interface graphically save those are resource file that u load into application at run time.


 9) What the difference b/w loadview and viewdidload?
 When you load your view from a NIB and want to perform further customization after launch, use viewDidLoad. If you want to create your view programmatically (not using Interface Builder), use loadView.

10 )Which API’s are using in u r application?
  API means frameworks like UIkit, foundation, Core animation

No comments:

Post a Comment