I've got iMac (Retina 4K, 21.5-inch, Late 2015) with Mojave installed and I have Xcode Version 10.1 (10B61) installed also. My application is for my own use and is developed to run on my iMac under Mojave Version 10.14.1 (18B75).
The program generates various reports at user request and it allows the user to send a copy of any report to a designated recipient. This is implemented by using scripting bridge to create an email message, fill in values for the sender, recipient, subject, and message content. In addition the user can supply an array of strings that, all appearances of any one of the strings that may appear in the text of the message will appear in BOLD.
The process requires creation a MailOutgoingMessage. Before calling methods to manipulate properties of the MailOutgoingMessage, it must be added to the outgoingMessages container of the mailApp. However
[[mailApp outgoingMessages] addObject: emailMessage];
followed by:
emailMessage.sender = [[NSUserDefaults standardUserDefaults] objectForKey:@"SNS_EmailSender"];
generates the error:
[General] *** -[SBProxyByCode setSender:]: object has not been added to a container yet; selector not recognized [self = 0x600000d3bd20]
In fact the following code:
NSLog(@"[mailApp outgoingMessages] <%ld>",[[mailApp outgoingMessages] count]);
[[mailApp outgoingMessages] addObject: emailMessage];
NSLog(@"[mailApp outgoingMessages] <%ld>",[[mailApp outgoingMessages] count]);
present the following output in the log:
[mailApp outgoingMessages] <0>
[mailApp outgoingMessages] <0>
With the following code:
NSLog(@"emailMessage <%ld>",emailMessage);
[[mailApp outgoingMessages] addObject: emailMessage];
NSLog(@"emailMessage <%ld>",emailMessage);
the log reads:
emailMessage <<future 'bcke' with properties…
emailMessage <<future 'bcke' with properties…
These results make me think that a failure has occurred for the call:
[[mailApp outgoingMessages] addObject: emailMessage];
Is this a reportable bug?