Are you suppose to access UIView from another thread?

A lot of UI events in my apps take place in another thread. So in my uivewcontroller, it catches a button click for example, it launches a NSThread with some parameter. The reason I decided to use a thread is because if the duration takes long the UI completely locks up. The thread then fetches for some result and access a pointer to a UIView (a UILabel for example) and update it's content.
Now, is this model correct? I'm running in cases where setting the UILabel.text from the thread sometimes work, sometimes doesnt. I'm not sure how to debug. If I change the thread call to a standard method call (which blocks until results are ready) the text is updated correctly.
Any hints?

http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/ThreadS afetySummary/chapter950_section2.html

Similar Messages

  • How in the heck are you supposed to drag songs

    How in the heck are you supposed to drag songs from your music library to your device (iPhone or iPod) with the new iTunes? It was simple on the older version, but it isn't at all on this one. I'd appreciate any advice.

    Thanks. It did help. Plus I don't feel like such an idiot for asking probably a simple question because somebody else asked the same thing.
    Message was edited by: Mark T1

  • Can i catch an exception from another thread?

    hi,guys,i have some code like this:
    public static void main(String[] args) {
    TimeoutThread time = new TimeoutThread(100,new TimeOutException("超时"));
    try{
    t.start();
    }catch(Exception e){
    System.out.println("eeeeeeeeeee");
    TimeoutThread will throws an exception when it runs ,but now i can't get "eeeeeeeeeee" from my console when i runs the main bolck code.
    i asked this question in concurrent forums,somebody told me that i can't.so ,i think if i can do this from aspect of jvm.
    thank you for your help
    Edited by: Darryl Burke -- Double post of how to catching exceptions from another thread locking

    user5449747 wrote:
    so ,i think if i can do this from aspect of jvm. What does that mean? You think you'll get a different answer in a different forum?
    You can't catch exceptions from another thread. It's that easy. You could somehow ensure that exceptions from that other thread are always caught and somehow passed to your thread, but that would be a different thing (you would still be catching the exception on the thread it is originating from, as is the only way).
    For example you can use setUncaughtExceptionHandler() on your thread to provide an object that handles an uncaught exceptions (and you could pass that uncaught exception to your other thread in some way).

  • Python ldap write access (acl) from another machine?

    i've downloaded and installed:
    http://python-ldap.sourceforge.net/
    and used this example code:
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303336
    and i'm using this code to connect to another machine that is running a vanilla install of leopard 10.5.2.
    The search works fine, but add and delete return this error:
    {'info': 'no write access to parent', 'desc': 'Insufficient access'}
    It would appear that the default acl for * doesn't allow for other computers to have write access?
    access to *
    by set="user/uid & [cn=admin,cn=groups,dc=test,dc=mydomain,dc=com]/memberUid" write
    by dn.exact="cn=test.mydomain.com$,cn=computers,dc=test,dc=mydomain,dc=com" write
    by sockurl="ldapi://%2Fvar%2Frun%2Fldapi" write
    by * read
    What I don't understand about acls is: are the 'by' lines all additive? if I was to add a new acl like the one below, will that give other computers, when authenticated as someone in the admin group, write access?
    It would appear that the default acl for * doesn't allow for other computers to have write access? or commenting out the dn=exact and sockurl?
    access to *
    by set="user/uid & [cn=admin,cn=groups,dc=test,dc=mydomain,dc=com]/memberUid" write
    by * read
    do i add this to /etc/openldap/slapd_macosxserver.conf and restart the server?

    Hi,
    You can check these few text-book style troubleshooting steps :-
    1. Can you PING the system computername from another System ?
    2. Can you check the ServerName Parameter in httpD.Conf of your IAS's Apahce & check if it contains computername ?
    3. Can you check if you can access http://computername:7777 or http://computername:7778 ( Default Ports ).
    4. Can you Telnet to computername at Port 80 ( using some software like Putty ) and issue Http Commands like GET / HTTP/1.1 ( just to check if the port is open ) ?
    Regards,
    Sandeep

  • HT1933 How are you supposed to do this when it DOESN'T EVEN WORK!!!! you press report problem and it comes up saying " too many http redirects". Total useless !

    How are you supposed to REPORT THE PROBLEM when it DOESN'T EVEN WORK!!
    I clicked it as I got a receipt for something that HAS NOT EVEN BEEN BOUGHT ! (It's funny how apple try to charge me twice for something when I work nightshift and my phones switched off!)
    and all that happened was it came up saying "too many HTTP redirects" .
    And it won't let me report it ! X

    Go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report your issue to the iTunes Store.
    Regards.

  • TS3704 How are you supposed to fix "The feature you are trying to use is on a network resource that is unavailable" alert appears when you remove Apple software in Windows if it doesn't work on Windows 8 or 8.1???

    How are you supposed to fix "The feature you are trying to use is on a network resource that is unavailable" alert appears when you remove Apple software in Windows if it doesn't work on Windows 8 or 8.1???

    See Troubleshooting issues with iTunes for Windows updates. You may have to uninstall what you can, reboot and delete the named folders, then reinstall.
    tt2

  • What are you supposed to do instead of Adobe flash when you hit a site that requires it while using iphone?

    New to iphone and first time using the web I get a message that I can't view a page because Apple blocks Adobe Flash. There seems to be some big story behind this, but what are you supposed to do to view those sites? Sorry if there is an obvious answer somewhere but I'm muddling my way through all of this!
    Thanks,

    Nothing unless they have an HTML only option you can click on the bottom of the page. However a page that requires flash only is most likely that of a company or business with heavy marketing content. Most websites with useful content either don't base their entire homepage on flash or have a mobile version for smartphones. So if you're visiting company or movie websites just do it on your computer. Apple and now adobe considers that the battery hit for flash animations is not worth it for phones. Most flash content is pure advertising rubbish anyway. I always install Adblock on all my browsers and barely see any flash except for videos and websites where the flash is not advertising.

  • Are you supposed to clear out the all document section, which seem like a big garbage can?

    Are you supposed to clear out the all document section, which seem like a big garbage can?

    Eh? Documents is a folder. You keep your documents in it. Or do you mean this thing...
    That's the Trash, it's where you put stuff that you no longer want.
    Yes, you are suppose to empty it occaisionally.

  • HT201272 I'm having trouble downloading a previously purchase song to my iCloud so I can access it from another device.  The iCloud download button is not there.  Help?

    I'm having trouble downloading a previously purchase song to my iCloud so I can access it from another device.  The iCloud download button is not there.  Help?

    I agree. I don't rely on iCloud as a backup, that is what I have my portable hard drive for. Its 500 GB so I can hold my entire iTunes library several times over on it. I have all my movies on my hard drive, but somehow "The Mist" got deleted off of my hard drive, so I figured "Well, the option to redownload an already purchased movie is available through iCloud, I'll just do that!"
    And permissions and download availability have nothing to do with it, the movie's still there, it still allows me to redownload it. The only problem is when I click download, I get that message.
    And nobody else uses my computer, but I do have multiple accounts authorized on it. Even still though, I am attepmpting to download it through the account I purchased it under. :/

  • Are you supposed to get e-mail receipts after purchases ?

    Hi all -- I just made an iTunes purchase, are you supposed to get e-mailed a receipt ? Thanks.

    Yes, but sometimes they run late. For example, my last download was on the 18th, I just received the e-mail receipt today.

  • How are you supposed to play a photo cd on a macbook pro?

    how are you supposed to play a photo cd on a macbook pro? when i put it in my drive, it says something like disk type not supported when i open up the dvd player. please tell me if theres some kind of software i have to download..please and thank you

    when you insert the disk it should be in the side bar of finder. double clickt he disk and you should have some sort of file in it. I'm not sure what softwware was used to create the slideshow but if it's a movie you'll have to figure out what type of media it is. I think VLC media player will be your best bet to play this CD/dvd though.

  • Are you suppose to pay for iCloud?

    Are you suppose to pay for iCloud?

    Kappy wrote:
    No. A basic iCloud account comes with 5 GBs of storage space, and it is free.
    Guess I'll concede this round

  • Are you supposed to charge the ipod fully b4 putting music or as long....

    are you supposed to charge the ipod fully b4 putting music or as long as its "charging"...

    Ben
    the ipod comes to you with a minimum charge on it
    do you have to fully charge it before using? No..
    should you fully charge it within 1-2 days of having it? Yes!

  • Which user are you supposed to run jobs as in PP?

    which user are you supposed to run jobs as in PP?

    The traditional user for PcP version 1 xgrid jobs is pcastxgrid, an OD user.

  • How are you supposed to put on and take off music on the new version of iTunes?

    How are you supposed to put on and take off music on the new version of iTunes?

    If you  have iTunes 11 turn on the Sidebar. Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar and Control+B to show the Menu bar
    To sync to your iPod go to iTunes>Help>iTunes Help>Sync your iPod....>Sync You Device>Set up Syncing and follow the instructions.

Maybe you are looking for

  • I restored my Iphone 5 and now it won't activate

    I restored my factory unlocked Iphone 5 to see if I could lower the size of OTHER and now I tried to activate it but it keeps saying that the Iphone could not be activate it because the activation server cannot be reached. I have tried to activate it

  • How to hide an iView from a User w

    Hello Experts. Is there any way to hide an iView from some group of people? Fox example, we have a role (Role A) containing a page containing the iView (Role->Page->iView) and we want to hide this iView for users that don't have some another role or

  • Running an mib query for T_CLIENT for a specific group

    I run the following query using ud32 SRVCNM .TMIB TA_OPERATION GET TA_CLASS T_CLIENT TA_FILTER 167778596 TA_FILTER 33560784 TA_FILTER 33560726 TA_LASTGRP 6 TA_FLAGS 65536 It is supposed to show result ony for TA_LASTGRP = 19. But instead wher i execu

  • Change production sys. SID in LMDB for an ongoing Charm project

    Hi all, We are in the process of configuring Charm on Solman 7.1 SP12 In our current scenario, BSD and BSQ have been already upgraded. So they are in the same release. Production system (BSP) however has been not upgraded yet. Therefore, in LMDB ther

  • Running Weblogic6.0 SP2 as a Service on Windows 2000 failes!?

    I installed j2sdk1.3.1. I have allso checked 'Interact with desktop' box and inserted -Xrs option in 'set CMDLINE' variable in installNtService.cmd - file. Despite all these Service dies after 10 seconds. What else can I to do?