SDK3.0 save user defaults before app exit

Hi,
I would like to save some parameters to NSUserDefaults before my app exit so next time when the app launch those parameters could be recovered. But I am not sure where is the best place the do the saving. I used to do it in applicationWillTerminate, but it does not work very well for sdk3.0.
Any ideas?
Thanks,
ff

Hi "Just.do.it":
Thank you very much for your post. Yes, I did see a lot of "crashes on termination" (from the crash log), and that is why I think "applicationWillTermninate" is not a good place. How can I debug and fix the "crashes on termination" problem?
Some informaiton about my app:
In side my app, user loaded image from album. When the app exits, I would like to save this image to a file, and some other information to "UserDefaults".
Thanks again.
ff

Similar Messages

  • Value conversion according to User default

    Hi,
    I have a Problem in a BDC. I am trying to populate pick quantity filed in my BDC ( Tcode VL02N ) the BDC works fine for a particular user default setting( NNN,NNN.NN ). But is the same program is used by some other user whose Default settings are different ( NNN.NNN,NN ) BDC fails .
    I need to convert the value based on user default before passing it to the field in BDC.
    pl. suggest me the solution .
    Thanks.
    Hitesh

    Hi
    Try to use the WRITE command before transfering the value to BDC table
    DATA: QUANTITY(20) TYPE C.
    WRITE <QUANTITY> UNIT <UNIT> TO QUANTITY.
    <BDC>-VALUE = QUANTITY.
    APPEND <BDC>.
    In this way the WRITE statament'll write the quantity in the format according to user default parameters.
    Max

  • How to  read header texts in the on save user exit of VA01

    Hi Experts,
    I have a requirement to read the header texts in the on save user exit.
    I have to check whether departmental code in header text is not initial or not.
    Can any one please pour in some points of how it can be done......
    Thanks in Advance.
    Prem

    Hi
    U can use fm READ_TEXT:
    DATA: THEAD LIKE THEAD,
          TLINES LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.
    THEAD-TDID     = <text id>.
    THEAD-TDSPRAD  = <language>.
    THEAD-TDOBJECT = 'VBBK'.
    THEAD-TDNAME   = VBAK-VBELN.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                            = THEAD-TDID
        LANGUAGE                      = THEAD-TDSPRAD
        NAME                          = THEAD-TDNAME
        OBJECT                        = THEAD-TDOBJECT
      TABLES
        LINES                         = TLINES
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
       WRONG_ACCESS_TO_ARCHIVE       = 7
       OTHERS                        = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    U can use it in all situations ( inserting and updating) because that fm returns the buffered text.
    Max

  • Firefox saves user preferences to prefs.js when exit it, is this redundant?

    I have a question regarding to why Firefox saves user preferences to prefs.js when exit it.
    My observation is that Firefox saves changes immediately to prefs.js when users modify preferences either through Option (Windows)/Preferences (Mac, Linux) menu or directly through about:config page. Therefore, the prefs.js file should always in sync with the browser.
    However, I notice that Firefox saves preferences to prefs.js in the end when I exit the browser. I am wondering if this feature is redundant since all preferences are in sync between prefs.js and browser? Or maybe some preferences are not saved immediately? If that is the case, how to identify those preferences that are not saved immediately?
    Thanks in advance!

    It is possible that there are situations where there are some prefs that need to be changed and where the two files differ.<br />
    This can happen if you use Clear Recent History and Firefox wasn't able to complete that task.<br />
    Another possibility is to restart Firefox to complete the installation of add-ons and there are probably more cases.

  • Query on Billig Save User-exit

    Hello Folks,
    This question is related to SD (Billing Area).
    We have a requirment, In the Billing Save User-exit 'RV60AFZZ', we need check for the VAT Reg No of the Sales Org in a Z-table, if its not configured in it then we need to stop the Billing creation.
    i.e, when sy-subrc ne 0, stop the Billing generation.
    We tried with the commands 'check' and 'Exit', these did not work. The control exits from RV60AFZZ but the billing is still created. Then we tried command 'STOP'. This works good in online mode (VF01), however in batch mode there is an issue. The billing for the particular document (when sy-subrc ne 0) is stopped, however the job skips all the docs for billing generation. But the Job does not abort.
    I know that the copy control routines are the perfect choices for implementing this kind of logic. However due to the other requirements we had to put the logic in the Billing save User-exit,
    Can someone help me here.
    I need to stop the billing generation( in batch mode )for a particular doc based a check (if sy-subrc ne 0) and the batch job should invoice the rest of the docs which it picks from the Billing due list.
    Regards,
    Mohan Krishna

    Hi
    U can use fm READ_TEXT:
    DATA: THEAD LIKE THEAD,
          TLINES LIKE STANDARD TABLE OF TLINE WITH HEADER LINE.
    THEAD-TDID     = <text id>.
    THEAD-TDSPRAD  = <language>.
    THEAD-TDOBJECT = 'VBBK'.
    THEAD-TDNAME   = VBAK-VBELN.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
        ID                            = THEAD-TDID
        LANGUAGE                      = THEAD-TDSPRAD
        NAME                          = THEAD-TDNAME
        OBJECT                        = THEAD-TDOBJECT
      TABLES
        LINES                         = TLINES
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
       WRONG_ACCESS_TO_ARCHIVE       = 7
       OTHERS                        = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    U can use it in all situations ( inserting and updating) because that fm returns the buffered text.
    Max

  • Default Email app not working after update on 5/3 on S4. It checks mail but never downloads anything. Last updated screen stuck on date and time just before update

    After the last update, the default email app is not working as expected. It can send email but when it checks email, it never downloads any new messages. The last updated display at the top of the screen shows that the last successful update was on 5/3 just before the update took place. I will probably just download an email app and can this one but thought I would ask in case there is an easy fix.

    On my S4, a little message "Master sync turned off" blinks at the bottom of the email app when I tried to manually sync.
    On another thread, I discovered that you have to go into the settings toggle screen (swipe down from the top, hit the little four-square icon in the upper-right) and find "Sync".  That has to be turned back on.  For whatever reason, it was off on my phone after NC5 installed, and the email program needs it to be on.  Was it always there?  I don't know.
    There is a separate sync setting that you can change inside the email app for each account... but they all cease functioning if the "Sync" is off.  So make sure the main "Sync" is on, and maybe that will restore your email function.  Good luck!

  • How do I make Photoshop the default Edit App for .jpg in Windows 7?

    How do I make Photoshop the default Edit App for .jpg in Windows 7?    I want to be able to right click on a .jpg file, select the EDIT option in the Context Menu, then have Photoshop edit the file instead of Paint.
    In Windows XP it was very easy to use the File Manger to associate the file type .jpg and action edit with Photoshop.    No so easy in Windows 7.  It is easy to change the default OPEN application, but I would like to leave Windows Viewer as the default OPEN application and have Photoshop as the EDIT applicaiton.

    Before I posted the original question here, I had probably spent a couple of hours trying to research it.   I hate to find no answer for something I know can be done.   So I spent some more time and found the following in the bowels of a Tech Forum that is generally way over my head.  I have modified it to be Photoshop specific.
    These instructions will update the default EDIT action for image types - jpg,png,gif and the variations.     If you are unfamiliar with editing the program registry you probably will want to back up your registry or take a system backup.
    1. Open up the registry editor (Regedit.exe).
    You will need to be signed on as a Windows user that is an administrator
    2. Find HKEY_CLASSES_ROOT -> SystemFileAssociations -> image ->  shell -> edit -> command
    This seems like it would be easy but it is not, because there are many key names that are very close (like System.FilesAssociations).   Keep looking because you will find it eventually. 
    3. Double click on "Default" (on right window pane) and update the program location.
    You should see that MSPAINT.EXE is the current program.
    Erase the existing value and enter you photoshop location in quotes followed by %1 in quotes.  For me this is "C:\Program Files  (x86)\Adobe\Adobe Photoshop CS4\Photoshop.exe" "%1"  
    Hit return.
    4.  Exit Regit and test.

  • How to save user name and system date in a table

    I have a form that allow users to enter some information...
    I want to save user name in one of the columns and system date in another column by default when the user submit the form to save data...
    Please advice...
    Thanks

    Hi talbo,
    The most reliable method is to use a before-insert trigger on your table. This way the columns will be set properly no matter how rows are inserted (via your app or any other means). Given your user name column is called "CREATE_USER" and your date column is called "CREATE_DATE" for example - include these lines in a before-insert trigger:
    :NEW.CREATE_USER := NVL(V('APP_USER'), USER);
    SELECT SYSDATE INTO :NEW.CREATE_DATE FROM DUAL;The NVL(V('APP_USER'), USER) will set CREATE_USER to the current ApEx application user if the row is created from within the application, or to the current database user if the row is created outside the application.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • Refresh page but SAVE USER INPUT in tabular form WITHOUT UPDATE

    Hi,
    When there is a tabular form in the page and user refreshes it (in anyway) tabular form's elements are always computed with values from the table in db. Can we somehow save user input in fields so that after refreshing page user will see what he/she has typed but not submitted to db?
    Regards,
    Tom

    Hello Andy,
    Let me introduce you to the problem.
    There is a tabular form based on a source table. User modifies the data and after he/she clicks Submit button the validation procedure is being run before MRU. If the result of validation is positive then MRU is run otherwise data should not be submitted to db and user should be informed about the result. Moreover, he/she should see the invalid data in fields. Not the correct one from db.
    Is there any way to save a session state of these fields or of a whole tabular form? I cannot save the data in other table in db.
    User cannot click 'Add row' several times in my app because after he clicks it once then the button disappears and appears again only when he/she clicks 'Submit' first (so after validation procedure).
    Maybe there is some way to store fields' values in memory and then compute the form when page is loading again?
    Imagine the situation that there are 100 rows in tabular form and user modifies it for one hour, clicks Submit, validation result is negative and his/her whole one hour work is lost, because the form has been refreshed according to what is stored in db. Such situation should never occur.
    Regards,
    Tom

  • User defaults problem

    Hi,
    I have a couple of textviews and checkbox buttons in my interface and I would like to save their states in the user's preferences.
    I'm trying to do it for the first text view but it doesn't work. Here is what I do in Interface Builder:
    -Added a "User Defaults Controller" binding.
    -Selected the NSTextView, in "Bindings" selected "User Defaults Controller" and checked the "Bind to" box.
    -Changed the value transformer to "NSUnarchiveFromData".
    -Saved and run from Xcode.
    Now the application crashes on startup so I guess I must be doing something wrong...!?
    Thanks for the help,
    Smaon

    http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/UserDefaul ts/Tasks/UsingDefaults.html#//apple_ref/doc/uid/20000719-BAJFBAAH
    Give that a read over
    Is your app a Cocoa app or an AppleScript app?

  • At my last update I can no longer save my tabs before shutting down. Can you help?

    At my last update I can no longer save my tabs before shutting down. Can this be changed?

    Firefox 4 saves the previous session automatically, so there is no longer need for the dialog asking if you want to save the current session.<br />
    Use "File > Exit" or "Firefox > Exit" if you want to restore multiple windows.<br />
    You can use "Firefox > History > Restore Previous Session" to get the previous session at any time.<br />
    There is also a "Restore Previous Session" button on the default <b>about:home</b> Home page.<br />
    Another possibility is to use:
    * [http://kb.mozillazine.org/Menu_differences Firefox/Tools > Options] > General > Startup: "When Firefox Starts": "Show my windows and tabs from last time"

  • Keep on getting double notification  from my default mail app, and gmail app, how do i make google my primary one?

    keep on getting double notification  from my default mail app, and gmail app, how do i make google my primary one? so that i dont have to get doulbe notifications  on both apps

    This is probably not the answer to all your questions, but I am sure it answers some.
    Unlike Word and InDesign, FrameMaker's anchored frames, which hold graphics, "hang" from their insertion points, typically at the end of the paragraph. An anchored frame that follows a paragraph is set to be below the line, the line being the last line in the paragraph. If you turn on View > Text Symbols, you will see a marker that indicates the point from which the anchored frame is hanging.
    If the anchored frame is taller than the available space, it is moved to the next page ALONG with that last line. If the paragraph style/tag has a widow/orphan lines number that is more than 1, then that number of lines are also moved to the next page, because the paragraph tag says to keep that many together, EVEN if there is space at the bottom of the previous page.
    So, you can set the widow/orphan lines number smaller OR as you have done put a blank line before the anchored frame, which now holds the marker for the anchored frame, and set its font size to 2 pt (the lowest FrameMaker allows) and its line height to zero. This is the standard workaround UNLESS you use the line above the anchored frame as the title/caption of a figure, which is also a typical way of dealing with FrameMaker's ways.
    To my knowledge, one cannot change the default of the checked cropped box. Maybe others know of some way to change this.
    There is no page break in FrameMaker, hence there is no symbol for it. In the paragraph designer for the paragraph, you set to Start of the paragraph to Top of page. Top of page is FrameMaker's equivalent to a page break. To "remove" a page break, set the Start of the paragraph to Anywhere.
    Since you are new to FrameMaker, I suggest reading throught the User Manual that comes with FrameMaker. You will likely find the answers to most of your questions there.
    Hope this helps,
    Van

  • Anyone has email notification problem w/ the droid & default email app?

    Just want to see if anyone/everyone out there has the same problem getting email notificaiton using default email app for gmail or any other email with all the setting enabled.   (I am not talking about gmail email app)

    questioning wrote:
    I just paid my Verizon bill on line but the only problem this time is that for some reason, I never received an email notification of my bill.  I just happened to stumble on my bill on line while I was reading about other information.
    I always received the email notification before and I never delete emails like that.
    What's going on?
    Interesting......I did receive a notification on 11/11 for my bill due 12/2. I have not received a notification for my bill due 1/1 and I received the 1/1 paper bill today. Just checked my Account Profile and found that the Bill Notifications box was not checked and I think that is the setting that controls the bill notification email (and/or SMS). I have been getting notifications each month for quite a while, so I am guessing some Verizon maintenance update caused the check to be removed. I have activated Bill Notification again so now I guess I just have to wait and see if I get one next month.
    I suggest you check your account profile to see if the Bill Notifications setting has somehow been turned off.
    Edit: I See you edited your post while I was writing mine.  I do not use paper-free billing so that is one difference.
    Justin
    FiOS TV, 25/25 Internet, and Digital Voice user
    QIP7232, QIP7100-P2, IMG 1.9
    Keller, TX 76248

  • How and where do you save user's account details?

    Just to clarify your needs:
    -The ability to store credentials in a secure location
    -The ability to access these stored credentials from ANY location on a computer or mobile device
    Keepass is a good product, and Pleasant Password Server for Keepass allows you to create Access Control Lists and potentially give access to the server over the internet. However this could be cumbersome, and storing credentials online always presents a security risk.
    Having your users connect to your network via VPN before accessing the keepass database (with pleasant password server app?) may be an option.

    I am just wondering what is a better way to save users account details that can be accessed easily and securily. Would you use Dropbox or Google drive or Sharepoint Online?
    This topic first appeared in the Spiceworks Community

  • I bought iPhone 3GS(Used) recently and updated ios 6.1.3 my iPhone is taking blurry Pictures through basic default Cam app.Can anybody please let me know any solution for this?

    I bought iPhone 3GS(Used) recently and updated ios 6.1.3 my iPhone is taking blurry Pictures through basic default Cam app.Can anybody please let me know any solution for this?

    Basic troubleshooting steps right out of the user guide are restart, reset, restore from backup, restore as new.  If you've been through ALL the steps and you still have the problem, then you'll need to bring your phone to Apple for evaluation.

Maybe you are looking for