This programming language may be used to instruct a computer to perform a task.
|Execution method:||Compiled (machine code)|
|Parameter passing methods:||By value|
If you know Objective-C, please write code for some of the tasks not implemented in Objective-C.
As of October 2011, with the release of XCode 4.2, Apple switched from gcc to Clang as its default compiler. Clang/LLVM offers competitive execution times, better compile times, improved error messages, and supports a simpler alternative syntax for expressing NSArray & NSDictionary literals and indexing. In the same release Apple also introduced automatic reference counting (ARC) which eliminates the need to manually release/retain memory. With ARC the compiler reports an error any time it encounters a call to release, autorelease, retain, or dealloc.
The release of Xcode 4.4 (4.5 for iOS) added syntax to specify literals for
NSString, as well as subscript syntax to access elements of
Unless otherwise stated, Objective-C code samples will assume that they are compiled with ARC enabled, and that the compiler supports Objective-C literals and Blocks.
For details of how to compile and run examples of Rosetta Code tasks written in Objective C under Linux or Windows see GNUstep
This category has the following 3 subcategories, out of 3 total.
Pages in category "Objective-C"
The following 155 pages are in this category, out of 155 total.
- Call an object method
- Check that file exists
- Closest-pair problem
- Closures/Value capture
- Command-line arguments
- Conditional structures
- Constrained genericity
- Copy a string
- Count occurrences of a substring
- Create a file
- Create a two-dimensional array at runtime
- Cumulative standard deviation
- Search a list
- Send an unknown method call
- Show the epoch
- Simple windowed application
- Singly-linked list/Element definition
- Singly-linked list/Traversal
- Sort an array of composite structures
- Sort an integer array
- Sort disjoint sublist
- Sort using a custom comparator
- Sorting algorithms/Bubble sort
- Sorting algorithms/Quicksort
- Sorting algorithms/Sleep sort
- Stable marriage problem
- Stack traces
- String case
- String concatenation
- String length
- String matching
- Strip a set of characters from a string
- Strip whitespace from a string/Top and tail
- Sum and product of an array
- Symmetric difference
- System time