Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Dec 10, 2008, 05:47 PM   #1
neil.b
macrumors member
 
Join Date: Nov 2008
Quitting Application & Open Files

I've got the AudioQueue stuff working to play sound in my application but I'm wondering what happens to all the opened audio files if the user quits the app using the home button, for example.

Do the open files get automatically closed?

What about audio buffers etc?

If I have to do manual cleaning up on exit, where do you do the cleaning up? I set a breakpoint in the dealloc method in my sound class but it doesn't seem to get called when the app is forced to quit (via the home button).
neil.b is offline   0 Reply With Quote
Old Dec 10, 2008, 06:09 PM   #2
dejo
Moderator
 
dejo's Avatar
 
Join Date: Sep 2004
Location: The Centennial State
Quote:
Originally Posted by neil.b View Post
If I have to do manual cleaning up on exit, where do you do the cleaning up? I set a breakpoint in the dealloc method in my sound class but it doesn't seem to get called when the app is forced to quit (via the home button).
Normally this is done in applicationWillTerminate: in your application delegate.
dejo is offline   0 Reply With Quote
Old Dec 10, 2008, 06:31 PM   #3
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
The OS mops up everything on termination, but it's often cleaner for your app to clean up the way you want in the applicationWillTerminate delegate.

It's also better for writing clean code and for debugging if you can account for everything in your termination delegate. e.g. if there's something you haven't closed or deallocated, it's a potential leak, etc.

.
__________________
Apple II+, Mac 128k->512ke, Duo 210, MacBook Air 11, iPhone 5, iPad Mini Retina
firewood is offline   0 Reply With Quote
Old Dec 10, 2008, 06:35 PM   #4
neil.b
Thread Starter
macrumors member
 
Join Date: Nov 2008
Thanks guys
neil.b is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Right-Click to Toggle Between Open Files in an Application MSchleicher Mac Basics and Help 0 Mar 8, 2014 10:24 AM
Quitting Open Applications. Good Idea? Pndrgnsvc iPhone Tips, Help and Troubleshooting 3 Jan 26, 2014 12:57 PM
Application Windows showing Preview & QuickTime's previously viewed files. globalone Mac Applications and Mac App Store 0 Dec 15, 2012 10:34 AM
Finally you can close all windows when quitting an application Doc69 OS X 10.8 Mountain Lion 2 Jul 28, 2012 08:51 AM
Since Lion & Restore can't open Excel files kimberleyallen Mac Basics and Help 2 Jul 21, 2012 06:43 AM

Forum Jump

All times are GMT -5. The time now is 12:37 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC