Vous êtes sur la page 1sur 2

1. The question mark ?

is used during the declaration of a property, as it tells the compiler


that this property is optional. The property may hold a value or not
2. the ! is used to tell the compiler that I know definitely(unwrap the optional)

3. Answer: let SwiftStringsArray = ["iPhone","iPad","iPod"]

let MySwiftString = SwiftStringsArray.joinWithSeparator(",")

print(MySwiftString)

4. control flow statement

5. The second line uses the stringForKey method of NSUserDefaults, which returns an
optional, to account for the key not being found, or for the corresponding value not being
convertible to a string

6. let Ustring : String = "iOS Developer Questions"

let characters = Array(Ustring.characters)

print(characters)

7. 5

8. Int and UInt as both are different and can’t be typecast without converting anyone of them

9. Cocoa and Cocoa Touch are frameworks that run on OS X and iOS respectively. They consist of
libraries, APIs, and runtimes

10. The reuseIdentifier tells UITableView which cells may be reused within the table, effectively
grouping together rows in a UITableView that differ only in content but have similar layouts
11. Not Running, Inactive, Active, Suspended, Background

12. Managed object context exists for three reasons: life-cycle management, notifications, and
concurrency. It allows the developer to fetch an object from a persistent store and make the necessary
modifications before deciding whether to discard or commit these changes back to the persistent
store. The managed object context tracks these changes and allows the developer to undo and redo
change
13. b

14. In an MVC model,


 Model– It represents the application data domain. In other words applications business logic
is contained within the model and is responsible for maintaining data
 View– It represents the user interface, with which the end users communicates. In short all
the user interface logic is contained within the VIEW
 Controller– It is the controller that answers to user actions. Based on the user actions, the
respective controller responds within the model and choose a view to render that display the user
interface. The user input logic is contained with-in the controller

15. Delegate: A delegate type object responds to actions that another object takes.
DataSource: Whereas a data source type object gives data to another object

16. let – constant declaration. Var- variable declaration

17. a

18. c

19. a

20. a

21. Double

22. "It's very windy".

23. "Sulaco", "Nostromo", "X-Wing", "TIE Fighter".

24. 128

25. TARDIS

26. "55" (a string).

27. Correct answer: "Galactica".

28. Correct answer: This code will not compile.

Vous aimerez peut-être aussi