Why could [NSString localizedStandardCompare:] produce different results?
Given this source code:
Something similar to Objective-C categories in other languages?
I understand Objective-C categories and how they become useful, but I always have a hard time explaining the concept to other programmers that are not familiar with Objective C.
Is conditional return type ever a good idea?
So I have a method that’s something like this:
Adhering to a protocol and being a subclass at the same time?
In objective C, I have a situation where I would like to have an abstract protocol (interface) with 5 methods and 4 properties, but at the same time, I’d like to have a common implementation of 3 of those 5 methods.
see what ARC does?
If I understand correctly, all ARC does is automatically add memory-management statements such as retain
and autorelease
in the proper places in a program. Is there any way to see all the memory-management statements that ARC automatically adds to a program?
Objective C style nil in java?
Objective C has a concept of a nil object which would accept any method call with any parameters without complaining and silently return another nil.
What is the convention for the star location in reference variables?
I have been learning Objective-C, noting that different books and examples use differing conventions for the location of the star (*
) when naming reference variables:
Strategy for avoiding duplicate object ids for data shared across devices using iCloud
I have a data intensive iOS app that is not using CoreData nor does it support iCloud synching (yet). All of my objects are created with unique keys. I use a simple long long
initialized with the current time. Then as I need a new key I increment the value by 1. This has all worked well for a few years with the app running isolated on a single device.
When should one use “out” parameters?
In Objective-C, there are several methods like initWithContentsOfFile:encoding:error:
where one passes in a reference to an NSError
object for the error:
parameter. In this example, the value of the NSError
object passed in can change based on what goes on at runtime when the method is being called and whether the body of the method was executed in a certain way successfully. In a way I think of this NSError
object as sort of like a second return value from the method, and only differs from an object anObject
in the statement return anObject;
in that when this statement is called, execution leaves the method.
What patterns book for iOS development contains this specific information? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for […]