PDA

View Full Version : alertView [iPhone]




sujithkrishnan
Jun 25, 2008, 01:56 AM
Hi all.

In my iHpone app, i am showing an alertview in a separate thread, while the main carry on with some parsing...

I call the showAlertView: method using [NSThread detach........] method..

I created the alertview as a property and i dismiss it after downlaoding completed in main Thread.

But i want to change the message of the alertview in middle of downloading to show which file i am parsing...

my code is like below.



// call showAlertView as a thread here
//loop start (4 times)

//parse file number n here

alertview.message = [NSStirng stringWithFormat:@"Downlaoding %d th file",i];

end of loop

//alertview dismissing here
//alertview release here



But the message is not changing , it remains same as what i used to initialize the alertview in thread...



tacoman667
Jun 25, 2008, 07:20 AM
Hi all.

In my iHpone app, i am showing an alertview in a separate thread, while the main carry on with some parsing...

I call the showAlertView: method using [NSThread detach........] method..

I created the alertview as a property and i dismiss it after downlaoding completed in main Thread.

But i want to change the message of the alertview in middle of downloading to show which file i am parsing...

my code is like below.



// call showAlertView as a thread here
//loop start (4 times)

//parse file number n here

alertview.message = [NSStirng stringWithFormat:@"Downlaoding %d th file",i];

end of loop

//alertview dismissing here
//alertview release here



But the message is not changing , it remains same as what i used to initialize the alertview in thread...

Have you tried sending an actual message to the object? For example: [alertView setText:@"File Being Parsed"];

This may be able to cross-thread talk between the 2 objects. I could be wrong though as I am from the Windows world of programming in C# and havn't multithreaded an application on Obj-C yet.