IOS interview questions A total of pen tests and test divides into two parts Pen test A total divided into 10 items 613 interview questions in a total of 400 pen try a 10 series, respectively (1) items (syntax), a total of 147 has been updated (2) items (common sense), a total of 72 has been updated (3) items (interface), a total of 83 has been updated ④(iOS) 52 questions ⑤(Operations) 68 questions ⑥(Data Structure) 23 questions ⑦(Multi-threading) 60 questions ⑧(Networking) 22 questions ⑨(multimedia) 59 questions ⑩(security) 27 questions The total number of questions is divided into three, totaling 400, for example, 127, for example, 127, for example, 2/3, for example, 137, for example, for 136, for example, 3/3

@TOC

Question 613

⭐️

1.The UIViewController didReceiveMemoryWaringWhen methods are called :[single choice]

  • A. External call
  • B. System error
  • C. The system memory is insufficient
  • D. The CPU usage is 100%

2. Which of the followingclassDuring iPhone app developmentCan'tUse :[Multiple choice]

  • A, UITableViewController
  • B, UINavigationController
  • C, UISplitViewController
  • D, UITableViewController

3. The following is not the standardUIButtonThe types are :[Single choice]

  • A, UIButtonTypeRoundedRect
  • B, UIButtonTypeContacAdd
  • C, UIButtonTypeRadio
  • D, UIButtonTypeInfoLight

4. When setting UIButton image, in order to adapt the image to the size of the button, the button contentMode should be set to :[Single choice]

  • A, UIViewContentModeScaleToFill
  • B, UIViewContentModeScaleAspectFit
  • C, UIViewContentModeScaleAspectFill
  • D, UIViewContentModecenter

About 5.UIControlandUIViewThe following statement is true:

  • A, UIcontrol inherits from UIView
  • B. UIView inherits from UIcontrol
  • C, UIcontrol has no inheritance relationship with UIView
  • D, UIcontrol, and UIView inherit directly from UIResponder

6. The followingUIViewWhich of the methods isiOS5.0Before and afterThe system call mechanism is different:[Multiple choice]

  • A, addSubView
  • B, layoutSubView
  • C, drawRect
  • D, removeFromSuperView

7. To constructUIImageIn the method of,Maximum memory usageWhich method of :[Multiple choice]

  • A, imageNamed
  • B, imageWithContentsOfFile
  • C, imageWithData
  • D. They are the same size

8. Which of the following methods areUITableViewthedelegateMethods :[Multiple choice]

  • A, (NSInteger) tableview: (UITableView) tableview numberOfRowsInSecion (NSInteger) section;
  • B, (UITableViewCell *)tableview:(UITableView)tableview cellForRowAtIndexPath:(NSIndexPath *)indexPath;
  • C, (CGFloat)tableview:(UITableView)tableview heightForRowAtIndexPath:(NSIndexPath *)indexPath;
  • D, (void)tableview:(UITableView)tableview didSelectRowAtIndexPath:(NSIndexPath *)indexPath;

9.UIResponderisUIViewThe parent class? :[Multiple choice]

  • A, right
  • B, errors,

10.UIControlisUIViewThe parent class? :[Multiple choice]

  • A, right
  • B, errors,

11.UITableViewIn the cellreuseAre composed of severalAn array ofAchieved :[Single choice]

  • 1 A,
  • B, 2,
  • C, 3
  • D, 4

12. ClickButton Response chain[Multiple choice]

  • A, window
  • B, Application
  • C, AppDelegate
  • D, UIViewController

In 13.UIKit,frameandboundsThe difference is :[multiple choice]

  • A, Frame is an alias of bounds
  • B. Frame is a bounds descendant
  • C. The frame reference frame is the superview coordinate system, and the bounds reference frame is its own coordinate system
  • D. The reference frame of the frame is its own coordinates, and the reference frame of the bounds is the coordinates of the superview

14.UIViewControllerIn the display process, the various methodsCall to orderYes :[Multiple choice]

  • A, init -> viewDidLoad -> viewDidAppear -> viewDidUnload
  • B, init -> viewDidAppear -> viewDidLoad -> viewDidUnload
  • C, init -> viewDidLoad -> viewDidUnload -> viewDidAppear
  • D, init -> viewDidAppear -> viewDidUnload -> viewDidAppear

Use 15.imageNamedMethod to create a UIImage object, and the normalinitWhat are the differences in methods:

  • A. No difference. Just for convenience
  • The imageNamed method just creates a pointer and allocates no memory
  • C. The imageNamed method loads the image into memory and does not release it
  • D. The imageNamed method will be released immediately after using the image

16. In the absencenavigationControllerIn the case of oneViewController switchTo anotherViewControllerDo :[Multiple choice]

  • A, [self navigationController pushViewController: nextViewController animated: YES];
  • B, [the self view addSubview: nextViewController. View];
  • C, [self pushViewController: nextViewController animated:YES];
  • D, [self presentModalViewController: nextViewController animated: YES];

17. What iskey window:[Multiple choice]

  • A, the only UIWindow object in the App
  • A UIWindow with a key can be specified
  • C, UIWindow that can receive events such as keyboard input
  • D. the UIWindow object that cannot be hidden

18.UIButtonInheritance from subclass to parent class once from:

  • UIView -> UIViewController -> UIcontroller
  • UIResponder -> UIControl -> UIView
  • C, UIControl -> UIResponder -> UIViewController
  • D, UIControl -> UIView -> UIResponder

19. The following is aboutUIViewandCALayerCorrect description :[Multiple choice question]

  • A UIView can be displayed because of the CALayer object inside it.
  • The real drawing part of UIView is managed by a CALayer class.
  • C. Add shadows, rounded corners, border width and color to UIView without going through CALayer.
  • D, access UIView root plot and coordinate related properties, such as frame, bounds, etc., are actually internal access to it contains CALayer related properties.

20.UIWindowProvides a surface for drawing content, which is the root container for all other views, per applicationYou can only have one window? [D].

  • A, right
  • B, errors,

21.UIViewThe view is the parent class of all controls. Controls are used to respond to user interactions, while UIView is responsible for the display and layout of content. [D].

  • A, right
  • B, errors,

22.UIControlClass is the parent of almost all interactive controls, such as buttons, sliders, text boxes, and so on. So the UIControl class is responsible for triggering actions based on touch events, right? [D].

  • A, right
  • B, errors,

23. Created after the iOS app startsThe first view controlisUIWindow? [D].

  • A, right
  • B, errors,

24. In iOS apps,Window objectDid not likeClose the dialogorTitle boxSuch an area, so the user cannot directly perform on itShut down? [D].

  • A, right
  • B, errors,

In 25.macOS,NSWindowIs the parent classNSResponder. iniOSIn the system.UIWindowIs the parent classUIResponder? [D].

  • A, right
  • B, errors,

26.macOS,NSWindowIs the parent classNSResponder. iniOSIn the system.UIWindowIs the parent classUIView? [D].

  • A, right
  • B, errors,

27.UIViewthealphaA property is aFloating point value, the value ranges from 0 to 1.0Completely transparenttoCompletely opaque[D].

  • A, right
  • B, errors,

28. When will beUIViewthealphaProperty set to0After that, the following description is correct :[Multiple choice]

  • A, the current UIView and its subviews are hidden, regardless of the alpha value of the view.
  • B. The current UIView is hidden, and the child view is not affected by the alpha value of the parent view.
  • C. The current UIView will not be removed from the responder chain. You can still accept touch events.
  • D. The current UIView is removed from the responder chain. And the next person in the responder chain will be the responder.

29. When will beUIViewtheisHiddenProperty set totrueAfter that, the following description is correct :[Multiple choice]

  • A, the current UIView and its subviews are hidden, regardless of the hidden value of the view.
  • B. The current UIView isHidden and the child view is not affected by the parent view’s isHidden value.
  • C. The current UIView is removed from the responder chain. And the next person in the responder chain will be the responder.
  • D. The current UIView will not be removed from the responder chain. You can still accept touch events.

30. By default, when adding a subview to a view, if the area of the subview exceeds the area of the parent view, the portion of the subview that exceeds the area of the parent view will still appear on screen as normal. [D].

  • A, right
  • B, errors,

31. InIOS Coordinate SystemIn coordinatesThe originLocated at :[Multiple choice]

  • A, the lower left corner
  • B. Upper right corner
  • C. upper left corner
  • D. Lower right corner

About 32.UIViewtheframeandboundsAttribute, the following description is correct :[Multiple choice]

  • A, the frame(Origin,size) property of A UIView defines A rectangle that describes the size of A UIView and the position of its parent frame.
  • B. The frame(Origin,size) property of UIView defines a rectangle that describes the size of a UIView and the position of its own coordinate system.
  • C, UIView’s bounds(Origin,size) property defines a rectangle that describes the size of a UIView and the position of its own coordinate system.
  • D, UIView’s bounds(Origin,size) property defines a rectangle that describes the size of a UIView and the location of its parent coordinate system.

33. In the rightUIViewView toZoom in, out or rotateAt the right time.centerThe value of the property occurschange? [D].

  • A, right
  • B, errors,

34. ByCGAffineTransformaffineconversion, what can be done to UIView viewtransformOperation :[multiple choice]

  • A, zoom
  • B, rotation,
  • C, hidden
  • D, displacement

35.UIViewControllerContains the followingfunction? [Multiple choice]

  • The UIViewController class is responsible for creating the views it manages and removing them from the content when memory is low.
  • B. New view content can be displayed as a modal window above the current view through the view controller.
  • C. View controller can respond to device direction changes and adjust the view accordingly. To adapt to the new direction.
  • D. Some special view controllers, such as navigation view controller and label view controller, can make view management more convenient and standardized.

About 36.UITabBarControllerAre the following statements correct? [Multiple choice questions]

  • A. UITabBarController cannot be added to other view controllers.
  • B. UITabBarController can be added to other view controllers.
  • C, UITabBarController’s Tab bar can be placed at the bottom or top of the screen.
  • D. The Tab bar of UITabBarController can only be placed at the bottom of the screen.

About 37.UINavigationControllerAre the following statements correct? [Multiple choice questions]

  • A, UINavigationController Navigation controller is used to display multi-screen and hierarchical content and is the main tool for building divided applications.
  • B. UINavigationController maintains a stack of view controllers, with all the child view controllers on the stack.
  • C. In contrast to UITabBarController, UINavigationController is implemented as a stack. It is better suited for processing and displaying hierarchical data.
  • D, UINavigationController The navigation controller manages, cuts, and slices multiple content pages, similar to UITabBarController.

38.UIControlOf the classUIControlEventWhat are the three main typesThe event? [Multiple choice]

  • A. Notification based control events
  • B. Based on the worth control event
  • C, touch based control events
  • D. Edit-based control events

39.UIButtonisUIViewA subclass of? [D].

  • A, right
  • B, errors,

40.Target - the Action mechanismCan apply to the same controlThe bindingmultipleAction[D].

  • A, right
  • B, errors,

41. If your view is not specifiedtintColorProperty, then this use will be usedThe parent classIn thetintColorAttribute? [D].

  • A, right
  • B, errors,

42.UIButtonbytintColorThe range of influence istitleandimagethecolor? [D].

  • A, right
  • B, errors,

43. The following is concerningNSLineBreakModetheThe enumerationMembers, correctly described are :[Multiple choice questions]

  • A, ByWordWrapping means that the display unit is words, the back part is omitted and not displayed
  • B. ByCharWrapping displays characters as the display unit. The following parts are omitted
  • C. ByClipping indicates that the content length is the same as the width of the text and the last part is deleted
  • D. ByTruncatingHead indicates that the beginning is omitted and the tail text content is displayed

44.UISwitchtheThe size of theSetting isinvalid[D].

  • A, right
  • B, errors,

45.UITextFieldSupport for proxy modedelegate, but not supportedTarget - the mechanism of Action? [D].

  • A, right
  • B, errors,

46.UITableViewCan be used in the following situations :[Multiple choice]

  • A. Convenient for users to browse hierarchical data
  • B. Provide a list of alternatives
  • C, display a series of data index list
  • D. Use group structure to display details and more detailed Settings

47. Developers can be rightUITableViewCellWhat to do :[Multiple choice]

  • A. Customize the text title, icon and background light properties of the cell.
  • B. Select and highlight the cells.
  • C. Configure the attachment view of the cell.
  • D. Add, delete and change the position of cells.

48. The following is relevantUICollectionViewandUICollectionViewController, correctly described :[Multiple choice]

  • A, UICollectionView and UICollectionViewController class is iOS 6 newly introduced API.
  • B. The standard UICollectionView object includes three parts: Cells, Supplementary Views and Decoration Views. These three parts are subclasses of UIView.
  • The C, UICollectionView class is responsible for managing an ordered collection of data and rendering it using a custom layout model.
  • In addition to multi-column layouts, UICollectionView can also achieve tiled layouts, circular layouts and more custom layouts.

49.iOSThere is only inheritance inUIResponderClass to be processedtouchEvent? [D].

  • A, right
  • B, errors,

50.UIViewControllerView controller,UIApplicationAre allinheritanceSince theUIResponder? [D].

  • A, right
  • B, errors,

51. IfUIWindowObject cannot handle a touch event, the touch event is discarded. True Or false

  • A, right
  • B, errors,

52.UIGestureRecognizerClass contains which of the following gestures:

  • A, UIPanGestureRecognizer
  • B, UIRotationGestureRecognizer
  • C, UILongPressGestureRecognizer
  • D. UISwipeGestureRecognizer.

53.UITapGestureRecognizerBelong toDiscontinuous typeThe gesture? [D].

  • A, right
  • B, errors,

54.UIPinchGestureRecognizerBelong toDiscontinuous typeThe gesture? [D].

  • A, right
  • B, errors,

55.StoryboardThe story edition feature is available inWhich iOS versionPublished :[Multiple choice]

  • A, ios
  • B, ios 5,
  • C, iOS6
  • D, iOS7

56. The following pairsStoryboardThe story version features the correct description of [multiple choice]

  • A. You can make learning easier by simply dragging and dropping various interface controls to the view controller. Provides efficiency and fun for development efforts. Make development work more human.
  • B. You can better view and understand the appearance of all pages in the project and the link jump relationship between pages.
  • C. Storyboard quickly implements jump relationships between views.
  • D. By rewriting the prepareForSegue method, all jump logic of view controller is gathered together to facilitate unified interface jump and parameter transfer.

57. The following pairsStoryboardThe story version features the correct description of [multiple choice]

  • A. Storyboard uses Cell ProtoType and Static Cell features to make table controllers easier to implement
  • B. In Storyboard, constraints can be established by drag and drop to quickly achieve adaptation of various resolutions.
  • C. As a Storyboard contains more and more view controllers, it will be slower and slower to open.
  • D. Modularization and reuse of functions can be achieved by separating common functions such as registration and sharing modules into a Storyboard.

58.StoryboardIn fact, byXML Text files made up of extensible Markup Language[D].

  • A, right
  • B, errors,

Use 59.Single View Application templateCreate the project that willBring their ownWhich twoStoryboard file? [Multiple choice]

  • A, Home. The storyboard
  • B, the Main storyboard
  • C, the Index. The storyboard
  • D, LaunchScreen. Storyboard

60. Which of the following marks represents fromstoryboardtheThe connectionMethods? [Multiple choice]

  • A, @ IBMethod
  • B, @ IBOutlet
  • C, @ IBAction
  • D, @ IBProperty

In 61.LaunchScreen.storyboardIn the story version, you can’t use UIWebView, because you can’t use webView here. [D].

  • A, right
  • B, errors,

62. Can provideIPhoneandiPadSpecify differentLaunchScreen.storyboard[TRUE]

  • A, right
  • B, errors,

63.LaunchScreen.storyboardThe story version can use UIView or UIViewController, but custom subclasses can’t, okay? [D].

  • A, right
  • [] B

64.CALayerIs defined in thatThe frameworkIn the? [Multiple choice]

  • A, UIKit
  • B, Foundation,
  • C, QuartCore
  • D, the Core Image

65. Pass the operationCALayerObject, which interface properties of UIView can be easily adjusted? [Multiple choice]

  • A, the shadow
  • B, rounded corners,
  • C, border
  • D. gradual discoloration

66.UIColor,UIImageWhich is the definitionThe framework[Multiple choice]

  • A and Foundation.
  • B, CoreGraphics
  • C, UIKit
  • D, the Core Image

67.UIKitIOS only, not macOS? [D].

  • A, right
  • B, errors,

68.QuartCoreThe framework can be used directlyUIColor,UIImage? [D].

  • A, right
  • B, errors,

69.CALayerandUIViewThe same can be done with userstouchEvent? [D].

  • A, right
  • B, errors,

70.UIViewCan be achieved bysubviewsProperty accessAll the subviewsSimilarly,CALayerAlso throughsublayersProperty to access allsub-layer? [D].

  • A, right
  • B, errors,

71.UIViewCan be achieved bysuperviewProperty accessParent viewSimilarly,CALayerAlso throughsuperlayersProperty to access allThe parent layer? [D].

  • A, right
  • B, errors,

72. If twoUIViewisFather and sonSo what’s inside of themCALayerIs alsoFather and son? [D].

  • A, right
  • B, errors,

Because 73.UIViewThe object is already at its internal root leveldelegate, so can not be in aUIViewSet up theCALayerthedelegate? [D].

  • A, right
  • B, errors,

74.UIKitIn the framework ofIOS ArchitectureWhich floor? [Multiple choice]

  • A. Core OS Layer
  • B. Core Services Layer
  • C. Media Layer
  • D. Cocoa Touch Layer

75.iOSWhat kind of user interface do you haveCreate a way? [Multiple choice]

  • A, Xib
  • B, Storyboard
  • C, PhotoShop
  • D. Code creation

76.IPhone XWhat is the resolution ratio of? [Multiple choice]

  • A, 4:3
  • B, 16:9
  • C, and
  • D, o

77. The following is relevantIPhone XIs the size description correct? [Multiple choice]

  • A. Height increased by 145pt to 812pt
  • B. Status bar height changed from 20pt to 44pt
  • C. Physical resolution 1125px by 2436px
  • D. The iPhoneX has a 5.8-inch screen

78.iOS11The default height of the navigation bar was? [Multiple choice]

  • A, 32 pt
  • B, 48 pt
  • C, 64 pt
  • D, 96 pt

79.iOS11Then if set fromprefersLargeTttles = YES, the height of the navigation bar is? [Multiple choice]

  • A, 32 pt
  • B, 48 pt
  • C, 64 pt
  • D, 96 pt

In 80.iOS11If black appears around the icon when the APP starts, it is because the four corners of the icon are rounded and surrounded by transparent pixels. [Multiple choice]

  • A, right
  • B, errors,

81. Which of the following attributes isiOS11It was introduced in the beginning to controlsafeAreaInsetsWhether or not tolayoutMarginsOn [multiple choice]

  • A, layoutMargins
  • B, directionalLayoutMargins
  • C, preservesSuperviewLayoutMargins
  • D, insetsLayoutMarginsFromSafeArea

82. Which of the following attributes isiOS8Introduced at the beginning, used to specifyviewAnd it’sChild viewsBetween themargin[Multiple choice]

  • A, layoutMargins
  • B, directionalLayoutMargins
  • C, preservesSuperviewLayoutMargins
  • D, insetsLayoutMarginsFromSafeArea

83.LayoutSubViewsWhen is it called? [D].

  • A. When the frame of the View itself changes
  • B. When the View itself changes bounds