Where is the location to free shared resources?

Hi everyone:
I have a shared instance of a class that stores several global objects. It is allocated like this:
+(SharedData*)sharedInstance
//RETURN: Pointer to this singleton class
static id sharedInstance = nil;
if(sharedInstance == nil)
sharedInstance = [[self alloc] init];
return sharedInstance;
My question is where are you supposed to release this shared instance?
PS. I tried doing it from applicationWillTerminate: after doing this:
UIApplication *app = [UIApplication sharedApplication];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:UIApplicationWillTerminateNotification object:app];
but it is never called.

Den B. wrote:
Loading images and sound takes all that time. I'm not that good yet at programming under iOS, so I don't know much about Core Data.
Core Data won't help much for images and sound, but how much of that do you have? Are you downloading it or is it in your app bundle? It shouldn't take that long. Plus, there may be some OS caching facilities you can take advantage of. Maybe consider loading images and sounds as you need them instead of all at once. Then there is nothing to worry about. Methods that don't exist are very easy to debug.
As for applicationWillTerminate: not being called, I put an NSLog statement in it to check. That's how I was able to find out. Are there any better ways to do it? (Because I'm not sure if a debugger break point would trigger in that situation.)
Are you sure you have connected an application delegate? Your previous post had a strange notification observer that didn't look right.
What do you mean by that? That it is not at all necessary to dealloc it since the app is terminating anyway and all of its memory will be released, right?
Yes, but I wouldn't put it like that. I once spend a long, long time debugging a program where the original author assumed the objects would be cleaned up at exist. He had not envisioned me using his module in another part of the code and then releasing it. It is always best to clean up.

Similar Messages

  • Where is the location of the default package?

    I'm using jdk1.6.0_14. There is a folder src. I guess the folder contains all the default package. And I try to delete the src folder, and then compile and run a simple program:
    import java.util.Scanner;
    public class TesImport {
         public static void main(String[] args) {
              Scanner s = new Scanner(System.in);
              System.out.println(s.nextDouble());
    }...but it still work... Actually, where is the location of the default package?
    Really need your help.
    Thanks

    JoachimSauer wrote:
    georgemc wrote:
    Eclipse defaults to thisSince I'm using maven, I really like the default structure of files there:
    - */src/main/java* is for Java sources
    - */src/main/resources* is for resources
    - */src/test/java* is for Java sources for the tests
    - */src/test/resources* is for resources for the tests
    - */target* contains everything produced by the build
    - */target/classes* contains compiled Java classes from /src/main/java and resources from /src/main/resources
    - */target/test-classes* contains compiled Java classes from /src/test/java and resources from /src/test/resourcesMe too. Presumably you use the Maven plugin to generate Eclipse projects too? One of the things Maven-haters moan about is that it enforces it's own directory structure on you, which quite apart from not being not true, isn't a bad thing anyway. That structure is a pretty sensible default

  • Where is  the location(path) of the videos that the 3GS recorded?

    Where is the location(path) of the videos that the 3GS recorded? Thanks. Kevin

    that's a private folder, so there's no method to access it. The only documented way to get videos from the camera roll is by using image picker (in 3.0 atleast)

  • Where is the location of tablespace file and control file

    Hi, all
    where is the location of tablespace file and control file? tks

    For DataFiles, query DBA_DATA_FILES or V$DATAFILE
    For TempFiles, query DBA_TEMP_FILES or V$TEMPFILE
    For Online Redo Logs, query v$LOGFILE
    For Archived Redo Logs, query v$ARCHIVED_LOG
    for Controlfiles, query v$CONTROLFILE
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Where is the location of Adobe Connect server?

    Where is the location of Adobe Connect Server?
    At the moment we are experiencing too much delay.
    It seems that Adobe connect server is not around Korea ,Japan nor China.
    That's just my guess.
    Is there any specialist who can give me the right answer for the locations of Adobe Connect server?

    Depending on which cluster you have an account on they can be in a few locations in the US,  Canada (I think) or Western Europe. Adobe doesn't have a hosted cluster in APAC, so it is likely that you are seeing lag due to communications to a server in the Western US.

  • Where are the files stored for shared applications?

    Hello,
    When I go to iTunes/iPad/Apps and then choose Pages under "File Sharing" and move a few files over, where are those files stored? Does iTunes make another copy and store it somewhere or does it just reference the location I copied from?
    Also, if I move a file over and then delete that file, does it delete from the File Sharing section as well the next time I sync?

    The information/data for apps is stored together with the app in both the iPad and in the backup on your computer. When you drop a file in the file sharing section of apps it gets added to the backup and to the iPad. When you delete it it get deleted from the backup and from the iPad.

  • Where is the file that was shared to media browser?

    I'm trying to delete stuff that I don't need. Where are the movie files that are shared to mediabrowser?

    Take a look at this link, https://discussions.apple.com/thread/1687092

  • Where's the location of JSP's java files in weblogic

    When I put *.jsp in my Web application,
              I can find the complied class in
              C:\bea\user_projects\mydomain\myserver\.wlnotdelete\extract\myserver_BOFT_BO
              FT\jsp_servlet\****.class
              But anyone can tell me where the ***.java?
              What's the location of these java files ?
              Samuel
              

    In WL8.1, it appears that the .java files are placed in the same directory,
              but are removed after the class is compiled successfully. (Is there a
              setting to prevent the .java files from being deleted?)
              Try placing an intentional syntax error in your JSP file so that the
              compilation fails, and you should see the .java file where the .class file
              would have been.
              -- Craig
              "Samuel Hsu" <[email protected]> wrote in message
              news:3fc4365a$[email protected]..
              > When I put *.jsp in my Web application,
              > I can find the complied class in
              >
              C:\bea\user_projects\mydomain\myserver\.wlnotdelete\extract\myserver_BOFT_BO
              > FT\jsp_servlet\****.class
              > But anyone can tell me where the ***.java?
              > What's the location of these java files ?
              >
              > Samuel
              >
              >
              

  • Where is the location bar item list stored?

    Upon typing URLs in the location bar a drop down item list will appear.
    Is there somewhere in firefox where this list of items is stored?
    If so, is that in a format I can go through and see each item?
    Thank you

    It worked.
    Thank you very much the-edmeister.
    Some details:
    - Add-on installed: SQLite Manager 0.7.7
    - From SQLite Manager you need to open the places.sqlite and it is stored under
    [DRIVE]:\[users]\[pc user]\AppData\Roaming\Mozilla\Firefox\Profiles\[one of the profile]\
    on Windows 7(64bit).
    - On the left side of SQLite Manager program main window there is a tree structure of tables, Views, Indexes etc. You need to go to under Tables and click on moz_places. On the center of the SQLIte program main window now you should see the table with its columns. The URL column is the right one.

  • Where is the location of isight photo for new osx account?

    Hi all - my first post....
    When a new account is created and the (inbuilt) isight camera is used to take a login photo, where on the OS is that photo stored and in what format?
    Sorry if it's basic, but I've searched high and low for ages...
    David
    intel laptop   Mac OS X (10.4.9)  

    Welcome to Apple Discussions, David
    While your question may be basic, the answer is not so simple.
    Yours is actually a question about how OS X works rather than iSight.
    See Niel's Nov, 2006, response to Bernhard VonZastrow1's question in:
    http://discussions.apple.com/click.jspa?searchID=-1&messageID=3532758
    Because this old post has been archived and will be removed from view before this topic is, I quote Niel's response here for the record:
    The login picture can be anywhere on the hard disk; to find its current location, open the NetInfo Manager in the /Applications/Utilities/ folder, and check the picture property for your user account.
    To find this property for a system other than the one currently used to start up the computer, open the Terminal application in the /Applications/Utilities/ folder and run the following command:
    sudo nicl -raw '/Volumes/volumename/private/var/db/netinfo/local.nidb' -read users/username/
    This command will prompt you for your administrator password; nothing will appear in the Terminal window while it is being typed. Look for the picture line in the output to find the path.
    (17705)
    If Niel's response answers your question, please let us know, but wait for Niel to post here so you can credit him with the "Solved" points he deserves.
    If you need more help of info about this topic, you might want to post in Tiger Forums > Administration, Accounts & Login Discussions. Niel and other very smart folks will help you with your OS X questions there.
    Cheers,
    Jim
      Mac OS X (10.4.9)    G5 DP 1.8  External iSight

  • Where is the location of cabinet 12 served by Asco...

    By entering my telephone number and running an FTTC availability check on BT wholesale's website I find that it is available
    from Ascot exchange, Cabinet 12 and it gives me estimated down and up speeds, which seem to be appropriate for infinity 1
    but not fast enough for Infinity 2. I guess the checker must estimate the distance from the cabinet to my house and I would like this information .
    Where is the physical location of cabinet 12 ?
    Is there a map anywhere online which shows the locations of the cabinets served by a particular exchange ?
    I want to see how far my house is away from this cabinet and whether there are any other cabinets nearer.
    Thanks

    if you have checker results then this gives indication of distance 
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • HT1766 where is the location folder for devices backups?

    Where is the folder location for the devices backups?

    http://osxdaily.com/2009/09/11/iphone-backup-location/  - "in Mac OS X your iPhone files are backed up at the following location: ~/Library/Application Support/MobileSync/Backup/"
    in OS X:
    ~(your home directoy)/Library/Application Support/MobileSync/Backup/

  • WHERE IS THE LOCATION OF PICTURES TAKEN OF THE SCREEN OR PARTIAL SCREEN???????

    I know how to take them and in OS Snow Leopard the ended up in the Desktop. In Lion, the are nowhere to be found.

    Try this:
    http://hints.macworld.com/article.php?story=20050824073301844
    Create the folder in which you want the screen captures to be saved in the location of your choice.
    Open a Terminal window and type this: defaults write com.apple.screencapture location /Full/Path/To/Folder (e.g. Users/yourname/Desktop)
    Log out and log back in, and the change will have taken effect.
    If you are not familiar with terminal, download Onyx or TinkerTools, you can change the default location there too.

  • Where is the location bar?

    The location bar keeps disappearing from my Mozilla Firefox - version 4.0 . I've recreated the address bar 4 times and it keeps going away every couple of days. Windows 7 - on a laptop.

    Sounds like a problem with the file localstore.rdf
    * http://kb.mozillazine.org/Corrupt_localstore.rdf

  • Where is the Location on Preferences in CS5 ?

    Hello,
    I cannot find the location of preferences in CS5 ...
    I am sure I have it in front of me, but cannot see it
    Thankyou
    Jimba The Man
    http://www.youamatorial.com

    Thankyou very much !!!
    It was there .. but i could not see it
    Thxx again
    Jimba The Man
    http://www.docciafredda.com

Maybe you are looking for

  • BioShock 2 Live Chat - Transcript

    Transcript for “BioShock 2 Developer Chat”, Tues Feb 2 2010 (Part I) Aaron-GS: Good evening and welcome to our BioShock 2 developer chat! Tonight we have with us Jordan, Melissa and Zak from 2K Marin. Aaron-GS: This chat is queued and moderated, so p

  • System Alerts for Bank Guarantees and Letter of Credits

    Hi My requirement is to get system alerts when the the Letter of Credit(LOC) or Bank Guarantee (BG) is going to be expired. We are using Third Party software for  master data and other information related to  Letter of credit. In SAP ,I will  do spec

  • Vacation Period settings in bpm workspace

    Hi, I have enable vacation period for one user but still instacnes are being assigned to user and even vacation rule also is not working as expected. Please send me some documentation or sample which talks about vacation period configuration in oracl

  • How to update the field  BSEG-BDIFF

    Hi to All, do you know some funciont module or BAPI that update the field BSEG-BDIFF ? Thanks a lot. Best Regards, Umb. Edited by: Umberto Panico on Jan 18, 2011 10:40 AM

  • Transaction IDX1: Port SAPQA1, client 500, RFC destination  contain error

    Hi experts I am configuring XI for MM-SUS scenario, when I try to send Idocs from R/3 to XI I have this message: Transaction IDX1: Port SAPQA1, client 500, RFC destination  contain error In XI transaction IDX1 I have maintened a port (MM_QA1) and RFC