Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-14-2011, 06:47 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 3
y-o-r-g-u-n is on a distinguished road
Question How to change a label's text from another view?

hey i'm new in objective c and i have a problem. i have a program and in it there is a button and when i click that button a date picker appears. i choose date from it and i click ok button. when it returns previous view i want to write that day on a label.but i can not access that label. and the codes are here, please tell me what i'm doing wrong.

Quote:
-(IBAction) donebutton{
appDelegate = (iFly_ticketAppDelegate *)[[UIApplication sharedApplication]
delegate];

//Use NSDateFormatter to write out the date in a friendly format
NSDateFormatter *dateFormatter= [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];

NSString *dateString =[NSString stringWithFormat:@"%@", [dateFormatter stringFromDate: datePicker1.date]];
appDelegate.dateString = [NSString stringWithFormat:@"%@", dateString];
[dateFormatter setDateFormat:@"dd.MM.yyyy"];

NSString *dateString1 = [NSString stringWithFormat:@"%@", [dateFormatter stringFromDate:datePicker1.date]];
appDelegate.visibleDate = [NSString stringWithFormat:@"%@", dateString1];
[dateFormatter setDateFormat:@"EEEE"];

NSString *dayOfWeek = [NSString stringWithFormat:@"%@", [dateFormatter stringFromDate:datePicker1.date]];

iFly_ticketViewController* rw = [[[iFly_ticketViewController alloc] init] autorelease] ;

rw = (iFly_ticketViewController*)[appDelegate.navigationController.viewControllers objectAtIndex: 0 ];
if ([rw.nibName isEqualToString:@"iFly_ticketViewController"]) {
[rw.goingdatelabel setText:[NSString stringWithFormat:@"%@ - %@", dateString1, dayOfWeek]];
[dateFormatter release];

[self hideModal:self.view];
iFly_ticketViewController *tController = [[[iFly_ticketViewController alloc] init] autorelease];
tController = (iFly_ticketViewController*)[appDelegate.navigationController.viewControllers objectAtIndex[appDelegate.navigationController.viewControllers count]-1)];
[tController.view setUserInteractionEnabled:YES];
[tController.navigationController.view setUserInteractionEnabled:YES];



[dateFormatter release];
}
}

Last edited by y-o-r-g-u-n; 07-14-2011 at 06:50 AM.
y-o-r-g-u-n is offline   Reply With Quote
Old 07-20-2011, 08:29 PM   #2 (permalink)
Awesome
 
Esko2300's Avatar
 
Join Date: Jun 2009
Location: New York, N.Y.
Posts: 389
Esko2300 is on a distinguished road
Default

Use NSNotificationCenter thats your answer for stuff like that.
Esko2300 is offline   Reply With Quote
Old 08-03-2011, 08:21 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 3
y-o-r-g-u-n is on a distinguished road
Default

thanks a lot i solve the problem but this time i have another problem in my program.

i wanna connect a xml document and i wanna parse it and then write the returning result in a picker view. i use nsxmlparser and i connect the xml file but i cant parse and write it. i send the xml two parameters which are one of them is username and password and the other is process that needs to be return. and this parameters are in xml format like <Kalkis><Ulke></Ulke></Kalkis>
and the returning answer is an xml too.
when i wrote the returning xml in console i get this xml contains error message

Quote:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><XmlIsletResponse xmlns="http://tempuri.org/"><XmlIsletResult><IslemSonuc xmlns=""><Sonuc>false</Sonuc><Hata>Gönderdiğiniz XML Biçimi Uygun Formatda Değil</Hata></IslemSonuc></XmlIsletResult></XmlIsletResponse></soap:Body></soap:Envelope>
why the result contains error? i work hard to solve it but i cant. thank you in advance.
y-o-r-g-u-n is offline   Reply With Quote
Old 08-11-2011, 04:05 AM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

This should be in a new thread. Sounds like your request is not formatted properly and the server is telling you that.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Old 08-12-2011, 05:54 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 3
y-o-r-g-u-n is on a distinguished road
Default

well how can i solve this problem. i dont know what is the xml page's format. i've been told use the soap message which i added below.

Quote:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<XmlIslet xmlns="http://tempuri.org/">
<xmlIslem>xml</xmlIslem>
<xmlYetki>xml</xmlYetki>
</XmlIslet>
</soap:Body>
</soap:Envelope>
i really dont know what's wrong with that? i totally stuck and i dont know what to do.
y-o-r-g-u-n is offline   Reply With Quote
Old 08-12-2011, 12:22 PM   #6 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Jan 2010
Location: Issaquah, WA
Age: 42
Posts: 1,244
dljeffery is on a distinguished road
Default

Well, you'll have to show us your code for formatting the request.

Also, please use CODE tags (the hash mark on the toolbar) for code blocks, not QUOTE tags. Only CODE tags will result in properly formatted code blocks.
__________________
Recall It! Tag your notes. Tag your photos. Tag your thoughts. Tag your life.

Recall It! for iPad

http://www.dljeffery.com
dljeffery is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 479
16 members and 463 guests
7twenty7, AlanFloyd, AppsBlogger, David-T, HemiMG, iAppDeveloper, imac74, Jaxen66, lovoyl, Music Man, mutantskin, Paul Slocum, SLIC, solardrift, unicornleo, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,683
Threads: 94,131
Posts: 402,932
Top Poster: BrianSlick (7,990)
Welcome to our newest member, unicornleo
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:15 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0