+ 3

Objective C

In what way can objective-c be used except from iOS devices.

15th Aug 2020, 8:43 AM
Ndeanaefo Chidalu
Ndeanaefo Chidalu - avatar
1 Odpowiedź
+ 2
Objective-C is the primary programming language you use when writing software for OS X and iOS. It's a superset of the C programming language and provides object-oriented capabilities and a dynamic runtime. In contrast, most object-oriented systems at the time that it was created used large virtual machine runtimes. Objective-C applications tend to be larger than similar C or C++ applications because Objective-C dynamic typing does not allow methods to be stripped or inlined. Since the programmer has such freedom to delegate, forward calls, build selectors on the fly, and pass them to the runtime system, the Objective-C compiler cannot assume it is safe to remove unused methods or to inline calls. Unlike C++, Objective-C does not support operator overloading. Also unlike C++, Objective-C allows an object to directly inherit only from one class (forbidding multiple inheritances). Because Objective-C uses dynamic runtime typing and because all method calls are function calls, many common performance optimizations cannot be applied to Objective-C methods (for example: inlining, constant propagation, interprocedural optimizations, and scalar replacement of aggregates). With Objective-C you've been using properties that are auto synthesized. You're going to need setFoo and getFoo methods to do this when building your Android apps. Apple developers use SAViewController as class prefixes in Objective-C and Modules for Swift. Android development doesn't require any prefixes. Objective-C's features often allow for flexible, and often easy, solutions to programming issues: 1. Delegating methods to other objects and remote invocation can be easily implemented using categories and message forwarding. 2. Swizzling of the isa pointer allows for classes to change at runtime. Typically used for debugging where freed objects are swizzled into zombie objects whose only purpose is to report an error when someone calls them. Swizzling was also used in Enterprise Objects Framework to create database faults.
15th Aug 2020, 3:20 PM
Bits!