i have put app nice form laid out ipadand want pass varaible content specific iboutlet in form emailbody of email app send out. built in single view have several segmented controllers, , text boxes each own ibaction can use
to see actual content change in log file.code:nslog([nsstring stringwithformat:@"%@", [telephonenum text]]);
having difficulty passing information main email build functionality
here 1 ibaction segmented controllercode:mfmailcomposeviewcontroller
and textbox ibactioncode:- (ibaction)timeframeanswer:(id)sender { nslog(@"time frame"); switch (timeframe.selectedsegmentindex) { case 0: nslog(@"asap"); outtimeframe = @"asap"; break; case 1: nslog(@"1-3 months"); outtimeframe = @"1-3 months"; break; case 2: nslog(@"3-6 months"); outtimeframe = @"3-6 months"; break; case 3: nslog(@"6+ months"); outtimeframe = @"6+ months"; break; } }
i have been trying follow along in several tutorials on how done @ brick wall right nowcode:- (ibaction)emailanswer:(id)sender { nslog(@"email address"); nslog([nsstring stringwithformat:@"%@", [emailaddress text]]); outemailaddress = emailaddress.text; [emailaddress resignfirstresponder]; }
mfmailcomposeviewcontroller has variable in call emailbody , need load each 1 of these responses variable can once know syntax different variable contents.
created in .h file have created many variables similar this
and corresponding @synthesize in .m file in hopes correct processcode:@property (weak, nonatomic) iboutlet uitextfield *outtimeframe; @property (weak, nonatomic) iboutlet uitextfield *outemailaddress;
and release them in didunload methodcode:@synthesize outtimeframe; @synthesize outemailaddress;
in mfmailcomposeviewcontroller method building emailbody this
i think close in coding shown here missing type of syntax or simple.code:nsstring *emailbody = [nsstring stringwithformat:@"time frame: %@\nemail: %@",self.outtimeframe, self.outemailaddress];
1 other strange thing enter text 1 of textboxes has space "mickey mouse" see full string in log file shows in emailbody null if enter "mickey" "mickey" shows in emailbody.
know happens in piece
i see warnings throughout ibaction pieces of codecode:- (ibaction)fullnameanswer:(id)sender { nslog(@"full name"); nslog([nsstring stringwithformat:@"%@", fullname.text]); outfullname = fullname.text; [fullname resignfirstresponder]; }
"incompaitible pointer types assigning uitextfield * weak nsstring *"
1 above fullnameanswer clean of warnings
please give me detailed assistance if possible.
jeff
here:
definition of textfieldcode:outemailaddress = emailaddress.text;
error messagecode:@property (weak, nonatomic) iboutlet uitextfield *outemailaddress;
you treating textfield string , error message trying tell you. shouldcode:"incompaitible pointer types assigning uitextfield * weak nsstring *"
a recommendation wrt naming: if textfield name textfield, if it's string name string. way reducing confusion kind of object hide behind name.code:[outemailaddress settext:emailaddress.text];
- olaf
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
No comments:
Post a Comment