Xamarin Certification Xamarin.iOS Development 1 — Questions and Answers
Question 1: Which class is the entry point for a Xamarin.iOS application?
- AppDelegate (Correct answer)
- UIApplication
- MainActivity
- Application
Correct answer: AppDelegate
AppDelegate is the entry point for a Xamarin.iOS app and handles application lifecycle events.
Question 2: What attribute is used to register a Xamarin.iOS class with the Objective-C runtime?
- [Register] (Correct answer)
- [Export]
- [Bind]
- [ObjCClass]
Correct answer: [Register]
The [Register] attribute maps a C# class to its Objective-C counterpart in the runtime.
Question 3: In Xamarin.iOS, which method do you override to set the initial view controller programmatically?
- FinishedLaunching (Correct answer)
- ViewDidLoad
- OnCreate
- WillEnterForeground
Correct answer: FinishedLaunching
FinishedLaunching in AppDelegate is overridden to configure the window and root view controller.
Question 4: What is the purpose of the [Export] attribute in Xamarin.iOS?
- Exposes a C# method to Objective-C selectors (Correct answer)
- Exports the app to the App Store
- Marks a class as public
- Binds a Swift framework
Correct answer: Exposes a C# method to Objective-C selectors
The [Export] attribute exposes a C# method as an Objective-C selector so it can be called by the runtime.
Question 5: Which Xamarin.iOS class is used to display a list of items using a table-based layout?
- UITableView (Correct answer)
- UICollectionView
- ListView
- RecyclerView
Correct answer: UITableView
UITableView is the native iOS control for displaying scrollable lists and is used directly in Xamarin.iOS.
Question 6: In Xamarin.iOS, what file format is used for Interface Builder storyboards?
- .storyboard (Correct answer)
- .xib
- .axml
- .xaml
Correct answer: .storyboard
Storyboards with the .storyboard extension define UI flows and are supported natively in Xamarin.iOS.
Which class is the entry point for a Xamarin.iOS application?