Thread in IPhone

Discussion in 'Mac Programming' started by sujithkrishnan, Jun 5, 2008.

  1. sujithkrishnan macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #1
    Hi all...

    I am looking to create a thread application, which will go on running through out. Also i want to make the thread to start as soon as the phone starts...
    The thing is that how to check the current time inside a thread to trigger a operation

    Actually my thread is one which download a xml file at every 24hrs.. say everyday 01.00 am....

    Is NSThread is enough to satisfy my needs??

    But how to make the thread active when IPHONE restarts...

    please help....
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    The SDK explicitly prevents background applications. You cannot do what you want to do.
     
  3. sujithkrishnan thread starter macrumors 6502

    Joined:
    May 9, 2008
    Location:
    Bangalore
    #3
    Hi..
    i heard that "its possible, but those sdk APIs are buggy....."

    Is there any way, even though its not the proper way....
     
  4. ghayenga macrumors regular

    Joined:
    Jun 18, 2008
    #4
    Only if you jailbreak your phone, which is the only way to run non-Apple background applications.

    Using the SDK what you describe is specifically forbidden by Apple.
     
  5. Nonnus3G macrumors member

    Joined:
    Jul 9, 2008
    #5
    wait a little...
    in september apple will release some mechnism to send notifications to apps so they can be "awaken" at will
    for now i would advise you to just load the xml file on startup or maybe check if it is still valid (in your case the last midnight update...) and invest your time consolidating the rest of the application

    :)
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    Where did you get that information?
     
  7. Pring macrumors 6502

    Joined:
    Sep 17, 2003
    #7
    Not quite true. You can send an alert to ask the user if they want to launch the app. But there's no way to know that they've just turned their phone on to send the notification.
     
  8. Nonnus3G macrumors member

    Joined:
    Jul 9, 2008
    #8
    i was talking about application startup

    maybe i did not fully understand what you´re trying todo

    usually for the user any data will only be relevant after application launch so it can be updated at that time

    the info on the upcoming notifications scheme has been around since wwdc, even today or yesterday there are news aaround bout it on the new 2.1 sdk preview
     
  9. admanimal macrumors 68040

    Joined:
    Apr 22, 2005
    #9
    The notification service does not awaken apps or cause them to do any processing. All it does is alert you to the fact that you might want to run a particular app.
     

Share This Page