I was asked this question during a technical discussion and can't seem to find answer anywhere.
The problem:
If I wrote methods by extending a core class (Lets say NSArray
) which didn't exists in iOS 5 but were introduced in iOS 6.
What would happen to my application in the app store when the user upgrades to iOS 6? Would it crash? Would it be refer to foundation class? Would the runtime point to my function and everything will continue to work same?
Eg.
iOS 5.0
PGMyArray
: NSArray
- (NSString) info; // convert and concatenate each object of the array into a string.
Now in iOS 6.0, Apple introduced the method publicly as part NSArray
NSArray
- (NSString) info; // Does exactly same as my method
What would happen when user upgrades to iOS 6.0 and my application calls
PGMyArray *myArray = [[NSArray alloc] init];
[myArray info];
My intelligent guess is, it would still be calling to PGMyArray-> info (after looking up from virtual table). However, I wasn't told the right answer and its bothering me for weeks now.
Any explanation / help is appreciated.