IPhone - Trying to Update View from Separate Thread

I am having trouble updating a view. My iPhone project is built from the Utility Application template. Upon startup, the Main View is loaded and some network communications are performed (on a separate thread). In response to the reply from the network, the toggleView method is called to switch to FlipSideView.
This works (view changes) when I call toggleView from applicationDidFinishLaunching or by pressing the "i" button on the MainView. When I call toggleView after getting a response from the network, toggleView is called (as evidenced by a NSLog called within the toggleView method) but the View does not update.
Does anyone have any ideas why this would happen?
Could it have anything to do with the fact that I'm calling toggleView from another thread? If so, why would toggleView be called but not work?
Thanks in advance,
Daedalus
- iPhone SDK Beta 8

Update... I figured it out.
To anyone else seeing this, when communicating between threads, you need to use the NSObject method performSelectorOnMainThread.
Thanks.

Similar Messages

  • When trying to update apps from iPad and iPhone a previous one time users email keeps coming up. How do I delete their information?

    When trying to update apps from iPad and iPhone a previous one time users email keeps coming up. How do I delete their information?

    delete off any apps that are asking for the wrong apple id and download/sync them over from the correct one

  • I am trying to update ITunes from 10.4 to 10.5 I have tried from both the program, and from a download on Apple's website. Regardless, I get the following error messages: (1) Installation package for iTunes cannot be found. Try installing to find the inst

    I am trying to update ITunes from 10.4 to 10.5 I have tried from both the program, and from a download on Apple's website. Regardless, I get the following error messages: (1) Installation package for iTunes cannot be found. Try installing to find the installation package 'iTunes.msi' in a folder from which you can install iTunes.  I can't find this folder. I have tried to completely unistall iTunes through the Control Panel, but it wouldn't let me: I tried going directly to the files themselves, but cannot uninstall. Any help would be greatly appreciated. System OS: Win XP SP 3.

    Set the permissions for Everyone in the folder in which CCPackager created, to "Read/Write" enabled. This is strange since there is only an administrator account on the Mac (and that account already has read/write), but it seems to resolve the issue.

  • I have a macbook 13in mid 2010, im trying to update it from 10.6.4... i update it and restart i but when it finishes restarting, it says its still 10.6.4 and i need to update? please help!

    I have a macbook 13in mid 2010, im trying to update it from 10.6.4... i update it and restart i but when it finishes restarting, it says its still 10.6.4 and i need to update? please help!

    Try downloaded the Mac OS X 10.6.8 Update Combo v1.1 standalone updater and installing it.

  • HT4972 Hi! I have tried to update OS from 4.3.5 to latest on Ipod touch but every time after 70% completing an error is prompted and say update cannot be completed. Please check the setting. Please guide in this respect to be updated.

    Hi!
    I have tried to update OS from 4.3.5 to latest on Ipod touch but every time after 70% completing an error is prompted and say update cannot be completed. Please check the setting. Please guide in this respect to be updated.

    Disable the computer's firewall and antivirus during the download and update.

  • There is no sim card installed in the iphone error after update software from 4.1 to 5.01(iphone 3gs)

    there is no sim card installed in the iphone error after update software from 4.1 to 5.01(iphone 3gs)

    Thanks for reply, but problem is diffrent I got updated my device via I tune(IPSW 5.01) before that, it was working well after upgreade 4.1 to 5.01 I am getting problem. No cydia no signal!
    BTW Thank you,

  • 4s stuck in recovery mode. try to restore apple icon comes up but goes itno recovery again. Itunes does not recognise. I wa trying to update software from laptop to phone and errored 4005.

    4s stuck in recovery mode. try to restore apple icon comes up but goes itno recovery again. Itunes does not recognise. I wa trying to update software from laptop to phone and errored 4005.

    Hi there Schusski,
    I would recommend taking a look at the troubleshooting steps for Error 4005 found in the article below. 
    iOS: Restore errors 4005, 4013, and 4014
    -Griff W. 

  • HT203433 Having an issue with my IPad and IPhone trying to update  my Apps from the Apps store?

    I am having a problem with my IPad and Iphone trying to do My Apps updates via the App Store. I see the # of 4 updates in red showing, but when i try to do the updates by hitting the "update button" I get an error message saying I can not connect to the iTunes store although I am signed in already?
    Anyone had the same problem?
    thx,
    Max

    I'm not aware of any viruses or malware for iOS devices (except for jailbroken devices), but it might be a software bug.
    Try closing all apps via the taskbar and then do another a reset and see if that helps. To close all app : from the home screen (i.e. not with any app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of each app to close them, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    Reset as before i.e. press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • IPhone 4s Software Update fail (from 5.1.1 to 6.1.3)

    Hey everyone
    I have been holding back from updating my iOS on my iphone 4s (I know - not a smart move) I am currently still on 5.1.1 and trying to update to 6.1.3 (finally) from the phone itself (not via iTunes)
    I am trying to downlaod and install the update using Wi-Fi connectivity, but it just wouldn't let me? Kept saying An Error occured while downloading...
    It didn't give me any error code or any other explanation. It just simply won't update
    I know it was silly of me to begin with for not updating for so long, but I don't understand why my phone is rejecting the update? If this is even what is happening..
    Also I sent my iMac for repair recently, came back with a Lion (which was what I had on there previously anyway) but it wasn't updated? So I couldn't just open iTunes and restore all my contacts..
    AND I am still currently in the process of downloading the updates - but something always happens as well, an error occured that I have to re-download the update, internet drops on and off, etc.
    The reason I wanted to update was (this is a whole separate problem) my 4s kept crashing the apps, not doing anything out of ordinary - it just crashes everytime i start or a open an app. So I would hard reset my phone (turning it off and on again) and then I would find all my contacts gone. No other entries are gone, just my contact names! All messages and calendar entries are all still there - just no contact names in my address book. ***?
    After sleuthing here and there, and found no real solution to this problem. I decided to update my iOS because one of the discussion thread I found told me to try that. Heck, why not.
    SO I tried uploading and this is where I end up..
    Does ANYONE have any idea what the **** is going on? Does anyone else out tehre have the same problem? Surely this is not just me!!

    Thanks RajaRani. But I decided to sleep on it last night and did another attempt of updating iOS through iPhone and also through iTunes this morning.
    Everything works normal now! And I also got my contacts back. I am not sure what happened there, so unfortunately this thread would be of no help to anyone else if RajaRani's advice didn't work. Hopefully it works for everyone else though

  • Very slow JTextArea updates even as separate thread

    Hi,
    I am trying to report output of a dynamic stream as a JFrame that contains JTextArea. The module is part of my big SWING application. The problem is JTextArea only shows update after the stream is empty. I have tried the following things
    * Stream pocessed as separate thread.
    * Thread priority set to maximum.
    * function updateUI is called after a batch of lines have been written.
    Here's the code to activate the thread
    StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT",outputWindow);
    outputGobbler.start();Here's the code for StreamGobbler class with JTextArea and JFrame
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        String thsContent;
        JTextArea outputWindow;
        StreamGobbler(InputStream is, String type,JTextArea dPane){
            this.is = is;
            this.type = type;
         outputWindow=dPane;
         thsContent=new String("");
        public void run(){
         int myMode=1;
         int lineCt=0;
         String myLineSep=new String(System.getProperty("line.separator"));
            try{
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null){
              if(myMode==1){
                  setDisplayWindow();
                  myMode=2;
                 System.out.println(type + ">" + line);
              outputWindow.append(line+myLineSep);
              lineCt++;
              if(lineCt==10){
                  outputWindow.updateUI();
                  lineCt=0;
             if(myMode==2)
              outputWindow.updateUI();
         } catch (IOException ioe){
             ioe.printStackTrace(); 
        public void setDisplayWindow(){
         setPriority(MAX_PRIORITY);
         outputWindow=new JTextArea("output",80,300);
         JScrollPane scrollingArea1= new JScrollPane(outputWindow);
         scrollingArea1.setPreferredSize(new Dimension(440, 210));
         scrollingArea1.setMinimumSize(new Dimension(400, 200));
         scrollingArea1.setMaximumSize(new Dimension(1000, 500));
         outputWindow.setEditable(false);
         JFrame displayWindow=new JFrame("Display Window");
         displayWindow.setContentPane(scrollingArea1);
         displayWindow.pack();
         displayWindow.setVisible(true);
    }

    Thanks for your reply sir.
    JDialog won't work for me. I need a JComponent that lets incremental display of content (like append method used in JTextArea).
    Below is my example code that you can run and see what I am trying to do. In this example the lines generated by ping are very few. My application actually uses an exe file instead of ping command. The .exe generates few KB of output. I am trying to stream the output of this exe to JTextArea. I am sorry I am not able to provied the actual exe itself.
    The example given below works well as the JTextArea gets filled as the output is printed on the command prompt window. It is because of limited resource consumption by ping command. This does not happen with my .exe file. The JTextArea is filled only after the .exe file stops executing. The few hundred lines printed by the .exe file appears suddenly instead of a continuous manner (Although the System.out.println continued to print the output on the command prompt console continuously like the ping example below). Thus there is a delay between the console output and JTextArea when using my exe file.
    import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class StreamGobbler extends Thread
        InputStream is;
        String type;
        String thsContent;
        JTextArea outputWindow;
        StreamGobbler(InputStream is, String type){
            this.is = is;
            this.type = type;
         thsContent=new String("");
        public void run(){
         int myMode=1;
         int lineCt=0;
         String myLineSep=new String(System.getProperty("line.separator"));
            try{
                InputStreamReader isr = new InputStreamReader(is);
                BufferedReader br = new BufferedReader(isr);
                String line=null;
                while ( (line = br.readLine()) != null){
              if(myMode==1){
                  setDisplayWindow();
                  myMode=2;
                 System.out.println(type + ">" + line);
              ///          thsContent=thsContent.concat(line);
              outputWindow.append(line+myLineSep);
              ///          outputWindow.append();
              lineCt++;
              if(lineCt==1){
                  outputWindow.updateUI();
                  lineCt=0;
             if(myMode==2)
              outputWindow.updateUI();
         } catch (IOException ioe){
             ioe.printStackTrace(); 
        public void setDisplayWindow(){
         setPriority(MAX_PRIORITY);
         outputWindow=new JTextArea("output",80,300);
         JScrollPane scrollingArea1= new JScrollPane(outputWindow);
         scrollingArea1.setPreferredSize(new Dimension(440, 210));
         scrollingArea1.setMinimumSize(new Dimension(400, 200));
         scrollingArea1.setMaximumSize(new Dimension(1000, 500));
         outputWindow.setEditable(false);
         ///     JPanel myPanel=new JPanel();
         ///     myPanel.add(scrollingArea1);
         JFrame displayWindow=new JFrame("MASPIC Run Window");
         ///     displayWindow.setContentPane(myPanel);
         displayWindow.setContentPane(scrollingArea1);
         displayWindow.pack();
         displayWindow.setVisible(true);
        public static void main(String args[]) {
    try{           
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec("ping localhost");
                // any error message?
                StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERROR");           
                // any output?
             ///            StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT",outputWindow);
                StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUTPUT");
                // kick them off
             ///            errorGobbler.start();
                outputGobbler.start();
                // any error???
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);       
            } catch (Throwable t){
                t.printStackTrace();
    }

  • Update view from BPEL process

    I am having a scenario where I have to update my view (Create or replace) using a sub query. And this sub query is going to have new data based on the where clause in it.
    I have tried using Create or replace view in the Pure SQL of DB adapter but that does not work for me.
    CREATE OR REPLACE FORCE VIEW <view_name>(<column_names>)
    AS
    SELECT <column_names>
    FROM <table_name_1> t1, <table_name_2> t2
    WHERE <conditions>
    Is there anything that I can do to update my view from the BPEL side?
    Thanks.
    Edited by: user1165407 on Jun 20, 2012 11:24 AM

    Hi,
    I don't think DB Adapter was designed to do DDL, so that's probably the source of your pain... DB Adapter is transactional and DDL usually is not...
    http://docs.oracle.com/cd/E17904_01/integration.1111/e10231/adptr_db.htm#TKADP1391
    I think you rowing against the current, but if you really want to do this from your BPEL using DBAdapter:
    May you can try wrap your CREATE VIEW into a PL/SQL package...
    And/or you can try to reconfigure the transactional behaviour of your Data Source...
    Cheers,
    Vlad

  • Trying to update Ipad2 from IOS 5.1 to IOS 6.1 but I get an error 9006

    I'm trying to update my Ipad2 from IOS 5.1 to IOS 6.1 but I get an error 9006.  I've tried updating several times but I get the same networking error.  I've tried disabling my computer and router firewalls, and made sure I have up to date Itune program, I even run the diagnostics on itunes and comes up that all connections are ok.  I also tried connecting directly from my modem, I still got the same result.  Now my Ipad has just the Itunes logo and a usb cable that's showing on it's screen.  I'm hoping I can get help with this because it seems like my Ipad is un-usable in this state.  Thanks in advance.
    PS: I also have an Apple TV 3 that's asking me to update, I run the update but it failed and asked me to run the update again.  Any help is greatly appreciated.  Thank you in advance.

    A third generation iPod touch can't be updated past 5.1.1. If you don't know what device you have, append the last three characters of its serial number to http://www.everymac.com/ultimate-mac-lookup/?search_keywords= and load the page.
    (107116)

  • Newbie needs help trying to update iMac from OS X v10.6.8

    Newbie trying to update iMac as far as it will go without having to purchase a new one yet.  Can I update from OS X v10.6.8 to OS X 10.7 with the following specs: Intel Core 2 Duo;  Processor Speed 2.66 GHz; Processors: 1; Cores: 2; L2 Cache: 6 MB;  Memory: 2 GB;  Macintosh HD: 63 items with 228.18 GB available?

    Upgrading to Lion
    If your computer does not meet the requirements to install Mavericks, it may still meet the requirements to install Lion.
    You can purchase Lion at the Online Apple Store. The cost is $19.99 (as it was before) plus tax.  It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
         Lion System Requirements
           1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
               or Xeon processor
           2. 2GB of memory
           3. OS X v10.6.6 or later (v10.6.8 recommended)
           4. 7GB of available space
           5. Some features require an Apple ID; terms apply.
    Upgrading to Yosemite
    You can upgrade to Yosemite from Lion or directly from Snow Leopard. Yosemite can be downloaded from the Mac App Store for FREE.
    Upgrading to Yosemite
    To upgrade to Yosemite you must have Snow Leopard 10.6.8 or Lion installed. Download Yosemite from the App Store. Sign in using your Apple ID. Yosemite is free. The file is quite large, over 5 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
        OS X Mavericks/Yosemite - System Requirements
          Macs that can be upgraded to OS X Yosemite
             1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
             7. Xserve (Early 2009) - Model Identifier 3,1 or later
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
         Are my applications compatible?
             See App Compatibility Table - RoaringApps.

  • Trying to update Xcode from the App Store

    I'm trying to update XCode 4.1 to 4.2 from the App Store and it fails (4 times so far!), tried fixing permissions, verifying the drive, down-loading Via WiFi and Wired; every time (after down-loading 1.8Gig) It just starts down-loading again
    This is the error log I get:
    14/10/2011 19:22:05.237 installd: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=123 "The update was cancelled because the application integrity could not be verified." UserInfo=0x7f975b571a10 {NSURL=file://localhost/var/folders/c8/578mym1j3_s3x_lls3pt7xkh0000gn/C/com.app le.appstore/448457090/mzm.lwqivlnf.pkg#InstallXcodeLion.pkg, PKInstallPackageIdentifier=com.apple.pkg.InstallXcodeLion, NSLocalizedDescription=The update was cancelled because the application integrity could not be verified.} {
        NSLocalizedDescription = "The update was cancelled because the application integrity could not be verified.";
        NSURL = "file://localhost/var/folders/c8/578mym1j3_s3x_lls3pt7xkh0000gn/C/com.apple.app store/448457090/mzm.lwqivlnf.pkg#InstallXcodeLion.pkg";
        PKInstallPackageIdentifier = "com.apple.pkg.InstallXcodeLion";
    I'm based in the UK (if that makes any difference), have also tried dropping the Firewall settings to the minimum I can (without switching it off), all other App store down-loads work OK as did the update to 10.7.2 (so I don't think it can be a network/firewall issue).
    The only thing I can think-of at the moment is removing 4.1 and trying a fresh install of 4.2 from the App store.
    Any other ideas or suggestions (I'm now getting very close to my monthly bandwidth limit)?

    By way of an update:
    The only way I cold het 4.2 was to un-install XCode 4.1 and do a clean install of 4.2. At least it allows me to back-up the installer to a DVD so I won't have to down-load it when I update the live dev machines.

  • Trying to update "Pages" from App Store. An old email address shows up and am unable to delete.

       I am able to purchase a new app from Apple App store using my current email address and password. I am not able to update a previously purchased app (for instance "Pages") that I purchased some time ago when I had a different email address. When I try to update Pages a "grey out"  edition of my old email address is sitting in the id box and I am not able to delete it or get it out of the box and use my newer (2 years) email address. I have even tried to update my current email address with a new password which has absolutely no effect when I try to update Pages. Anyboday have an idea on how to get the old email address out of the id box?

    Delete Pages and then download it from the desired Apple ID. This may require repurchasing it.
    (100086)

Maybe you are looking for

  • How can i log out from icloud without losing any document?

    I want to create a new icloud account, but first I need to delete the previous one without losing my documents.

  • C309g wireless setup with iMac i7 / Router D-Link DIR-300

    Just trying to get the wireless connection. I've just the USB-cable for the installation process evereything worked out fine. Now the test report shows that everything is OK. In mac os the printer is added to the print&fax menu status: green light. B

  • Failing at ACR step in process chain?

    Hi,   Could any body explain on this topic? In process chain job mostly the chain was failing at ACR(attribute change run) step. that it is materdata ACR step.i want permanent solution for this step? I want find why this ACR step is failing weekly tw

  • EMac won't power up

    I am assisting a small school with an eMac that will not power up. When the power button is pressed, the led lights up. There is a single beep, it is not the startup chime. Nothing else happens boot wise. The led will flash twice and then stay on, th

  • Use case for describing a web service

    Dear all, I have a fundamental question for describing a web service. An analyst will first write (1) a use case for describing the web service and (2) wsdl and xsd files for describing the web service. As a developer, I would say that artifact (2) i