Monday, December 5, 2016

Objective Questions in >= Swift2.2 @iPhone - Set I

Q.81: Which method is used to invoke a method by timer after a 
          interval
        A. NSTimer.scheduledTimerWithTimeInterval(interval, 
            target: AnyClassselector: Selector(“increaseTimer),  
           userInfo: Any?, repeats: Boolean)
        B. NSTimer.scheduledTimerWithTimeInterval(target:
            AnyClassselector: Selector(“increaseTimer),  
           userInfo: Any?, repeats: Boolean)
        C. NSTimer.scheduledTimerWithTimeInterval(interval,  
            selector: Selector(“increaseTimer),  userInfo: Any?
            repeats: Boolean)
          D. None

Q.82: What is UITableViewDelegate
            A. is a protocol you implement on your class to 
                receive UITableView events. 
            B. is a protocol you implement to provide data for 
                your UITableView .
            C. Both
            D. None

Q.83: What is UITableViewDataSource 
            A. is a protocol you implement on your class to 
                receive UITableView events. 
            B. is a protocol you implement to provide data for 
                your UITableView .
            C. Both
            D. None

Q.84: Which function is used to add number of rows in 
          TableView
            A. func tableView(tableView: UITableView
                  numberOfRowsInSection section: Int)
{
                             return intValue;  //intValue means a valid integer
}
B. func tableView(tableView: UITableView
     numberOfRowsInSection  section: Int) -> Int
{
                             return intValue;  //intValue means a valid integer
}
          C. func tableView(tableView:  ,  numberOfRowsInSection
              section: Int) -> Int
{
                             return intValue;  //intValue means a valid integer
}
          D.  None


Q.85: Which function is used to customize cell  with data source

A. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> Int
{
    return cell; //cell should be created by you 
}
B. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: ) -> UITableViewCell
{
    return cell; //cell should be created by you 
}
C. func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)
     -> UITableViewCell
{
    return cell; //cell should be created by you 
}
D.   None

Q.86: In Q.85 what is the significant of NSIndexPath

A.   index of Base row of table
B.    index of clicked row in table
C.    number of cells in Table
D.   None


Q.87: How to create cell using prototype cell

A.   let cell = UITableViewCell(style: 
                   UITableViewCellStyle.Default
                   reuseIdentifier: "prototypecell")
B.    let cell = UITableViewCell(
                       UITableViewCellStyle.Default
                   reuseIdentifier: " prototypecell ")
C.    let cell = UITableViewCell(style: 
                   UITableViewCellStyle.Default
                   reuseIdentifier: )
D.   None

Q.88: How user preferences can be stored in iPhone
          A. by using UserDefaults class
          B. by using NSUser class
          C. by using NSUserDefaults class
          D. None

Q.89: Which method is used to set the value with user 
          preferences
          A.  setObject(forKey : “ key name”)
          B.  setObject( “ Value  “ , forKey : “ key name”)
          C. setObject( “ Value  “ , “ key name”)
                D. None
            
            Q.90: Which method is used to retrieve the value for 
                      a key named name
                        A.  objectForKey()
                        B. objectForKey().name
                        C. objectForKey(“name”)
                        D. None


     Answers   A    A     B     B     C     B     A    C    B     C    

No comments:

Post a Comment