I found a bug in XCode 11.6 and/or Catalina 10.15.6. I have a work around listed below, but wondered if this a general problem that should cause concern?
In brief, I extended NSString class in Objective C with some personal convenience methods. Here is simplified header for "MyStringAdditiotions" showing just one convenience method:
The one method is code I wrote a long time ago to remove white space and then if needed remove quotes on a string using such code as
to return just uqString = quoted text.
The code itself is irrelevant and I am sure it is correct, but I got reports from users that it stopped working in Catalina. I was unable to reproduce their problems until I noticed that when I compile and run my app in XCode it works fine, but if I quit XCode and launch the app just compiled in XCode directly in Catalina, in runs differently and quotes and not removed. I tried NSLog() message in my unquote method. Those messages appear when running in XCode, but not when running in Catalina.
In summary, Catalina is not calling my convenience method. It is not, however, universal. I have lots of other methods in "MyStringAdditions" that are called correctly in Catalina. So far it appears only to be "unquote", but I cannot be sure and I don't know why the problem (hence the concern).
Two ways to fix it are to rename the method (e.g., to myUnquote) or to avoid using Objective C methods to extend a class (i.e., move the code to some other class). I thought maybe it was a naming conflict, but a search of developer documentation does not return any results for "unquote" in Objective C for NSString. Furthermore, if there was a conflict, it should affect running in XCode the same as running in Catalina (or at least give a warning of a conflict).
In brief, I extended NSString class in Objective C with some personal convenience methods. Here is simplified header for "MyStringAdditiotions" showing just one convenience method:
Code Block @interface NSString (MyStringAdditions) - (NSString *)unquote; @end
The one method is code I wrote a long time ago to remove white space and then if needed remove quotes on a string using such code as
Code Block NSString *myString = " \"quoted text\""; NSString *uqString = [myString unquote];
to return just uqString = quoted text.
The code itself is irrelevant and I am sure it is correct, but I got reports from users that it stopped working in Catalina. I was unable to reproduce their problems until I noticed that when I compile and run my app in XCode it works fine, but if I quit XCode and launch the app just compiled in XCode directly in Catalina, in runs differently and quotes and not removed. I tried NSLog() message in my unquote method. Those messages appear when running in XCode, but not when running in Catalina.
In summary, Catalina is not calling my convenience method. It is not, however, universal. I have lots of other methods in "MyStringAdditions" that are called correctly in Catalina. So far it appears only to be "unquote", but I cannot be sure and I don't know why the problem (hence the concern).
Two ways to fix it are to rename the method (e.g., to myUnquote) or to avoid using Objective C methods to extend a class (i.e., move the code to some other class). I thought maybe it was a naming conflict, but a search of developer documentation does not return any results for "unquote" in Objective C for NSString. Furthermore, if there was a conflict, it should affect running in XCode the same as running in Catalina (or at least give a warning of a conflict).