UI Exam Questions

Source: Internet
Author: User
Tags uicontrol

※ Choice question (Total 25 questions, 3 points per question) 1, when the program from the background will be back to the foreground, you will first do the following method:

Answer: (B)

    • A,-(void) applicationdidfinishlaunching: (uiapplication*) application{}
    • B,-(void) Applicationwillenterforeground: (UIApplication *) application{}
    • C,-(void) Applicationdidbecomeactive: (UIApplication *) application{}
    • D,-(void) Applicationwillterminate: (UIApplication *) application{}
2, for Uisearchbar, to achieve real-time search (that is, when the search content changes in real time), the following methods will be executed:

Answer: (C)

    • A,-(void) searchbartextdidendediting: (Uisearchbar *) Searchbar;
    • B,-(BOOL) searchbarshouldendediting: (Uisearchbar *) Searchbar;
    • C,-(void) Searchbar: (Uisearchbar *) Searchbar textdidchange: (NSString *) searchtext{}
    • D,-(void) searchbarresultslistbuttonclicked: (Uisearchbar *) searchbar{}
3. What is wrong with the following code:
@implementation person
-(void) Setage: (int) NewAge {
Self.age = NewAge;
}
@end

Answer: (B)

    • A, will cause A circular reference
    • B. will cause a dead loop
    • C, memory leaks will occur
    • D, there will be a wild pointer
4. The following methods for multithreading are not part of iOS:

Answer: (D)

    • A, Nsthread
    • B, Nsoperationqueue
    • C, Grand Central Dispatch (GCD)
    • D, Nsurlrequest
5. The following understanding of multithreading development is wrong:

Answer: (B)

    • A, take advantage of multi-core processor, concurrent execution makes the system run faster, smoother, better user experience
    • B, multithreaded programs, a process contains more than 2 threads (including 2)
    • C, a large number of threads reduce the readability of the code, but do not require more memory space
    • D. Be aware of thread safety issues when multiple threads are competing for the same resource
6, the following for UIView, UIWindow and Calayer understand the error is:

Answer: (C)

    • A, UIView inherit from Uiresponder
    • B, uiresponder inherit from Nsobject,uiview can respond to user events.
    • C, Uiresponder inheritance and nsobject,calayer inherit from Nsobject,calayer can respond to events.
    • D, UIView is used to display content, can handle user events, Calayer is used to draw content, rely on and uiview to display
7, for the Uiscrollviewcontroller,scrollview will start to spin down, the method of execution is:

Answer: (D)

    • A,-(void) scrollviewwillbegindragging: (Uiscrollview *) ScrollView; { }
    • B,-(void) scrollviewdidenddecelerating: (Uiscrollview *) ScrollView; { }
    • C,-(void) Scrollviewdidendscrollinganimation: (Uiscrollview *) ScrollView; { }
    • D,-(void) Scrollviewwillbegindecelerating:
8. For Uicollectionviewcontroller, the method for defining the margin (top-left-bottom-right) of each element is:

Answer: (B)

    • A
      -(Cgsize) CollectionView: (Uicollectionview *) CollectionView layout: (uicollectionviewlayout*) collectionviewlayout Sizeforitematindexpath: (Nsindexpath *) indexpath{   return Cgsizemake ();  }
    • B
      -(Uiedgeinsets) CollectionView: (Uicollectionview *) CollectionView layout: (uicollectionviewlayout*) Collectionviewlayout Insetforsectionatindex: (nsinteger) section{   return Uiedgeinsetsmake ();  }
    • C
      -(Cgsize) CollectionView: (Uicollectionview *) CollectionView layout: (uicollectionviewlayout*) collectionviewlayout Referencesizeforheaderinsection: (nsinteger) section{       return Cgsizemake ();  }
    • D
      -(Cgsize) CollectionView: (Uicollectionview *) CollectionView layout: (uicollectionviewlayout*) collectionviewlayout Referencesizeforfooterinsection: (nsinteger) section{   return Cgsizemake ();  }
9, in the MVC framework, M and C communication, usually use what way?//m and C K and C are all communicated by means of KVO.

Answer: (A)

    • A, KVO and notice
    • B, Protocol-agent
    • C, Category
    • D, Attributes
10, the following about the navigation bar appearance properties corresponding to the interpretation of the error is:

Answer: (D)

    • A, Barstyle bar style
    • B, Translucent bar transparency
    • C, backgroundimage bar background image
    • D, color of controls on Bartintcolor bar //Change the color of the navigation bar
11, the realization of a singleton class, the following is correct:

Answer: (A)

    • A
      Static Losingleton * shareinstance;+ (Losingleton *) sharedinstance{@synchronized (self) {  if (shareinstance = = nil) {   shareinstance = [[Self alloc] init];  } } return shareinstance;}
    • B
      Static Losingleton * shareinstance;-(Losingleton *) sharedinstance{@synchronized (self) {  if (shareinstance = = nil) {   shareinstance = [[Self alloc] init];  } } return shareinstance;}
    • C
      + (Losingleton *) sharedinstance{Losingleton *sharedinstance = nil; static dispatch_once_t Oncetoken;   Dispatch_once (& Oncetoken, ^ {    sharedinstance = [[Self alloc] init];}); return sharedinstance;}
    • D
      -(Losingleton *) sharedinstance{static Losingleton *sharedinstance = nil; static  dispatch_once_t Oncetoken;   Dispatch_once (& Oncetoken, ^ {    sharedinstance = [[Self alloc] init];}); return sharedinstance;}
12. Which of the following methods is called when the program is about to exit, and usually writes in this method to save the data and some cleanup work before exiting.

Answer: (B)

    • A,-(void) Applicationexitsonsuspend: (UIApplication *) application{}
    • B,-(void) Applicationdidenterbackground: (UIApplication *) application{}
    • C,-(void) Applicationwillterminate: (UIApplication *) application{}
    • D,-(void) applicationdidfinishlaunching: (UIApplication *) application{}
13. The Indexpath method for obtaining the cell TableView is displayed on the window is:

Answer: (B)

    • A,-(UITableViewCell *) Cellforrowatindexpath: (Nsindexpath *) Indexpath;
    • B,-(Nsarray *) indexpathsforvisiblerows;
    • C,-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) Indexpath;
    • D,-(void) TableView: (UITableView *) TableView Diddeselectrowatindexpath: (Nsindexpath *) Indexpath;
14, the following about deep copy and shallow copy understanding is correct:

Answer: (A)

    • A, deep copy copy of the content, a shallow copy copy is a pointer.
    • B, deep copy and shallow copy the biggest difference is whether the address of the sub-class object is changed.
    • C, a deep copy is a copy of the object itself, but not the properties of the object.
    • D, if the address of the subclass object is changed then it is a deep copy.
15, many built-in classes such as Uitableviewcontroller's Delegate property are assign rather than retain, this is to:

Answer: (D)

    • A. Prevent memory leaks
    • B, to prevent the emergence of wild hands
    • C, prevent excessive release
    • D, prevent circular references
16, about the OC memory management is wrong to say:

Answer: (B)

    • A, memory management in OC using reference counting mechanism
    • B, Autorelease Pool is an automatic garbage collection mechanism in OC
    • C, Alloc, new, or copy to create an object, you must call release or Autorelease
    • D, OC Memory management mechanism is essentially a C language manual management method, but a little bit of automatic method
17, about the system comes with the UITableViewCell, the following statement is correct:

Answer: (D)

    • A, Cell basic composition: editing, content, auxiliary
    • B, Editor: EditView. TableView is displayed when edited
    • C, Content: Contentview. Includes Imageview,textfield, etc.
    • D, Accessoryview. Show auxiliary information for cell
18, the application boot sequence is correct:
① override the Startup method in the UIApplication proxy instance, setting the first Viewcontroller
② Program Entry main function Create UIApplication instance and UIApplication Proxy instance
③ add controls to the first Viewcontroller to implement the corresponding program interface.

Answer: (B)

    • A, ①②③
    • B, ②①③
    • C, ①③②
    • D, ③①②
19. The correct notation for implementing a convenient constructor that generates student instance objects is:

Answer: (A)

    • A
      + (ID) studentwithname: (NSString *) newName andage: (int) newage{  Student *stu = [[[Student alloc] Initwithname: NewName Andage:newage] autorelease];  return Stu;}
    • B
      -(ID) Studentwithname: (NSString *) newName andage: (int) newage{Student  *stu = [[Student alloc] Initwithname:newname Andage:newage];  return [Stu Autorelease];}
    • C
      -(void) Studentwithname: (NSString *) newName andage: (int) newage{  Student *stu = [[Student alloc] Initwithname: NewName Andage:newage];  return [Stu Autorelease];}
    • D
      + (void) Studentwithname: (NSString *) newName andage: (int) newage{  Student *stu = [[Student alloc] Initwithname: NewName Andage:newage];  return [Stu Autorelease];}
20, the following about the view of the frame and bounds understanding of the error is:

Answer: (A)

    • A, bounds refers to the coordinates and size of this view in the window coordinate system.
    • B, frame refers to the coordinates and size of the view in its Superview coordinate system.
    • C, frame, and bounds are the two properties in UIView.
    • D, one is in the upper left corner of the store as the origin of the coordinate system, a point in the upper left corner of the screen as the origin of the coordinate system.
21. In the UITableView reuse mechanism, the reused cell is put into which type of collection.

Answer: (B)

    • A, Nsmutablearray
    • B, Nsmutableset
    • C, Nsdictionary
    • D, Nsmutabledictionary
22. When an application is about to go into an inactive state, during which time the application does not receive messages or events, such as a call, the following method is executed first:

Answer: (D)

    • A,-(void) Applicationdidbecomeactive: (UIApplication *) application{}
    • B,-(void) Applicationdidenterbackground: (UIApplication *) application{}
    • C,-(void) Applicationwillterminate: (UIApplication *) application{}
    • D,-(void) Applicationwillresignactive: (UIApplication *) application{}
23. Which of the following controls is not inherited from Uicontrol

Answer: (D)

    • A, UIButton
    • B, Uitextfield
    • C, UISlider
    • D, Uitextview
24. For Uisegmentedcontrol, the method of inserting an option at the specified index and setting the picture is:

Answer: (B)

    • A, [Segmentedcontrol setimage:[uiimage imagenamed:@ "Btn_jyy.png"] forsegmentatindex:3];
    • B, [Segmentedcontrol insertsegmentwithimage:[uiimage imagenamed:@ "Mei.png"] atindex:2 Animated:NO];
    • C, [Segmentedcontrol insertsegmentwithtitle:@ "Insert" atindex:3 Animated:no];
    • D, [[Uiimageviewalloc]initwithimage:[segmentedcontrol imageforsegmentatindex:1]];
25. For Uiscrollviewcontroller, the properties for monitoring the current scrolling position are:

Answer: (A)

    • A, Contentoffset
    • B, Contentsize
    • C, Contentinset
    • D, Scrollindicatorinsets
※ Judgment question (total 5 questions, 3 points per question) 1, UISlider, Uiswitch, Uitextfield These classes are inherited from the Uicontrol class.

Answer: (T)

    • That's right
    • Error
2, [Segmentedcontrol Titleforsegmentatindex:] Indicates the option to specify indexed text.

Answer: (T)

    • That's right
    • Error
3, [Self.view PopToViewController:animated:YES]; indicates that a view controller pops up to the specified view controller.

Answer: (F)

    • That's right
    • Error
4, [TextField Resignfirstresponder]; Indicates that the text input box becomes the first responder, and the keyboard pops into edit mode.

Answer: (F)

    • That's right
    • Error
5, numberoftapsrequired This method can get to have a few finger click.

Answer: (F)

    • That's right
    • Error
Close

UI Exam Questions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.