What are some of the major differences between objective c and swift?
Answer / Pankaj Mishra
"Objective-C is a superset of C, originally developed in the early 1980s by Brad Cox and Tom Love. Swift, on the other hand, is a newer language developed by Apple since 2014 as a replacement for Objective-C. Some major differences between them include:
- Syntax: Swift has a more modern syntax, focusing on readability and safety with features like optionals, error handling, closures, and generics, whereas Objective-C uses C-like syntax.
- Runtime: Swift is built on a newer foundation called Swift Standard Library (Swift SL) rather than the Objective-C runtime library used by Objective-C. This makes Swift faster and more efficient.
- Error Handling: In Swift, errors are handled with do-catch blocks, whereas in Objective-C, errors are usually passed around as NSException objects.
- Memory Management: Swift manages memory automatically through ARC (Automatic Reference Counting), while Objective-C developers have to manually manage memory using retain/release or ARC.
"
| Is This Answer Correct ? | 0 Yes | 0 No |
What is an accessor method?
When would you use nsarray and nsmutablearray?
What is objective c programming used for?
Which language does apple use?
How is #import different from #include?
What is synthesize objective c?
What is an nsobject?
What are the main objectives of training?
Can you learn swift without knowing objective c?
What is the difference between polymorphism and abstraction?
What are the rules of variable?
Explain application life cycle or application states?