Interviews2 answers
What happens when you invoke a method on a nil pointer in iOS?
2 Answers
A message sent to a nil object is perfectly acceptable in Objective-C, it's treated as a no-op. There is no way to flag it as an error because it's not an error, in fact it can be a very useful feature of the language.
Sourabh SharmaPosted Jun 27, 2016, 7:20 AM EDT
It returns 0, nil, a structure filled with 0s, etc.
Munesh SharmaPosted May 1, 2014, 9:48 PM EDT


