Question

Inside my MailComposeViewController I have this line of code to tell the view what the subject needs to be:

[mailer setSubject: _mailSubject];

_MailSubject is the UITextField name and of course setSubject is telling the UITextField to be the subject. My problem is that every time I enter in the subject into the UITextField and press my compose button, the app crashes. I know that it isn't the MailComposerViewController because I can enter in my email body into a UITextField and not have it crash. Here is the warning that appears next to it:

Incompatible pointer types sending 'UITextField'*_strong to parameter of type 'NSString*' 

Does anyone know what I'm doing wrong?

Was it helpful?

Solution

You need to get the text from the text field:

[mailer setSubject:_mailSubject.text];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top