Audio not playing when iPhone is sleeping - iphone

I would like to know one thing. I hope you people can guide me well.
I am creating an application which needs some audio alerts. I am using AVAudioPlayer for this purpose.
I also set the Audio session like this (in my main delegate class):
//to play from sleep
OSStatus result = AudioSessionInitialize(NULL, NULL, interruptionListenerCallback, self);
UInt32 category = kAudioSessionCategory_MediaPlayback;
result = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), category);
AudioSessionSetActive(YES);
I am able to play music if my screen is locked forcefully, but I am not able to play mp3 files if the iPhone go into sleep mode automatically.
In general after 10 minutes I am not getting any music from my application. Could anyone tell me what I am missing? Please guide me if you know about my problem.
EDIT 1
I am currently using kAudioSessionCategory_MediaPlayback.
I written it in my code, i pasted it here.
EDIT 2
I want to start a audio play back from a sleeping iphone.
Please help me if you know.
EDIT 3
idleTimerDisabled , consume my battery ?
I am creating a alarm so this application can run up to 10 hours.
It will disable light on screen?
then i can use it.
I already seen some application which running on iPhone which play music from sleep mode.
Let me try this, thank you for the reply.

I found the answer already on SO in this thread here and also in this thread on SO.
What's happening is that the iPhone goes into deep sleep mode after 10 minutes (after the screen is locked) where it stops your NSTimer's and goes into lower power mode. Even when you have the category set to MediaPlayback it will do this unless you are actually playing a sound. The solution given is to play a "silent" sound file periodically to prevent it from going into deep sleep mode.
Here's what I see in the console log at the time deep sleep occurs (the Warnings are from my clock app):
Thu Dec 24 09:25:09 unknown Clock[16346] <Warning>: ClockDigital itemInterval=0 curInterval=0 needsUpdate=YES
Thu Dec 24 09:25:09 unknown Clock[16346] <Warning>: BatteryIcon itemInterval=6 curInterval=0 needsUpdate=NO
Thu Dec 24 09:25:09 unknown CommCenter[28] <Notice>: Telling CSI to go low power.
Thu Dec 24 09:25:09 unknown CommCenter[28] <Notice>: CSI can enter low power, so now telling to do so.
Thu Dec 24 09:25:09 unknown CommCenter[28] <Notice>: Will sleep. Heard from CSI in 0.00501698 seconds
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleSynopsysOTGCore::sleepWakeNotification: Sysmtem Going to sleep
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AirPort: Disabled AppleBCMWLAN (link 2, sys 1, user 1)
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleBCMWLAN::setPOWER() [kernel_task]: Setting power state to 0
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleMultitouchN1SPI: disabled power
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleBCMWLAN Left BSS: # 0xcf3cc800, BSSID = 00:0f:a3:1c:9f:0c, rssi = -53, rate = 54 (100%), channel = 7, encryption = 0x2, ap = 1, failures = 0, age = 26, ssid[ 8] = "mggm.ap1"
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AirPort: Link Down on en0
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleBCMWLAN::powerOff Ready to power off
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleBCMWLAN::setPowerStateGated() : Powering Off and sleeping
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleBCMWLAN::powerOff Ready to power off
Thu Dec 24 09:25:10 unknown configd[22] <Error>: WiFi:[283368310.000857]: Unable to dispatch message to client dataaccessd (0x10000004)
Thu Dec 24 09:25:10 unknown configd[22] <Error>: WiFi:[283368310.013365]: Unable to dispatch message to client apsd (0x10000004)
Thu Dec 24 09:25:10 unknown Clock[16346] <Warning>: ClockVC: adjusted interval: 0.993291
Thu Dec 24 09:25:10 unknown configd[22] <Error>: WiFi:[283368310.018146]: Error initiating scan request: 82
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: AppleBCMWLAN::setPOWER(): IOKit power off. Discarding request.
Thu Dec 24 09:25:10 unknown Clock[16346] <Warning>: CalendarDay itemInterval=5 curInterval=0 needsUpdate=NO
Thu Dec 24 09:25:10 unknown Clock[16346] <Warning>: BatteryState itemInterval=6 curInterval=0 needsUpdate=NO
Thu Dec 24 09:25:10 unknown Clock[16346] <Warning>: MindfulnessBell itemInterval=2 curInterval=0 needsUpdate=NO
Thu Dec 24 09:25:10 unknown Clock[16346] <Warning>: ClockDigital itemInterval=0 curInterval=0 needsUpdate=YES
Thu Dec 24 09:25:10 unknown Clock[16346] <Warning>: BatteryIcon itemInterval=6 curInterval=0 needsUpdate=NO
Thu Dec 24 09:25:10 unknown kernel[0] <Debug>: System Sleep

You need to use a different Audio Session Category. You can check the documentation here.
I think the one you should use is kAudioSessionCategory_MediaPlayback.

To prevent your app from being silenced after n minutes, you might also need to set the UIApplication's idleTimerDisabled property to YES.

You should try this
[[AVAudioSession sharedInstance] setDelegate: self];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
[[AVAudioSession sharedInstance] setActive: YES error: nil];
referenced from a tutorial at http://www.mindyourcode.com/ios/iphone/how-to-play-audio-in-iphone-sleep-mode/

Related

iPhone app is working fine on iOS 4 but crashing on Launch screen at iOS 6

My Log report is.
Dec 21 15:44:26 New-iPod-Accuretech ReportCrash[1652] <Notice>:
Formulating crash report for process TextBook[1651] Dec 21 15:44:26
New-iPod-Accuretech kernel[0] <Debug>: launchd[1651] Builtin profile:
container (sandbox) Dec 21 15:44:26 New-iPod-Accuretech kernel[0]
<Debug>: launchd[1651] Container:
/private/var/mobile/Applications/CAD3777B-818F-4020-BCB7-813708315A0B
(sandbox) Dec 21 15:44:26 New-iPod-Accuretech com.apple.launchd[1]
(UIKitApplication:com.AccelApp.TextBook[0xfb6c][1651]) <Warning>:
(UIKitApplication:com.AccelApp.TextBook[0xfb6c]) Job appears to have
crashed: Trace/BPT trap: 5 Dec 21 15:44:26 New-iPod-Accuretech
com.apple.launchd[1] (UIKitApplication:com.AccelApp.TextBook[0xfb6c])
<Notice>: (UIKitApplication:com.AccelApp.TextBook[0xfb6c]) Throttling
respawn: Will start in 2147483647 seconds Dec 21 15:44:26
New-iPod-Accuretech backboardd[52] <Warning>: Application
'UIKitApplication:com.AccelApp.TextBook[0xfb6c]' exited abnormally
with signal 5: Trace/BPT trap: 5 Dec 21 15:44:26 New-iPod-Accuretech
ReportCrash[1652] <Error>: libMobileGestalt
copySystemVersionDictionaryValue: Could not lookup ReleaseType from
system version dictionary Dec 21 15:44:26 New-iPod-Accuretech
ReportCrash[1652] <Notice>: Saved crashreport to
/var/mobile/Library/Logs/CrashReporter/TextBook_2012-12-21-154426_New-iPod-Accuretech.plist
using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Just remove your Splash screen image Default-568h#2x.png . And then clean your code and remove previous build and then run again.

App crashes while not connected through Xcode

I got strange behavior for iOS App.
My App crashes only when it is not connected through XCode. Also, It crashes only after coming from back ground to foreground. I just gone through the crash log, as many links suggested to do that.
I am now unable to find out what the crash log says.
Jun 1 09:22:28 unknown SpringBoard[15] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=0
Jun 1 09:22:28 unknown SpringBoard[15] <Notice>: MultitouchHID: detection mode: 0->255
Jun 1 09:22:28 unknown UserEventAgent[12] <Warning>: DEBUG: Changing screen blanked state: 1
Jun 1 09:22:28 unknown kernel[0] <Debug>: [000070.133242]: AppleDPDisplay::setLCDStateGated:(0x81b4a000) Disabling
Jun 1 09:22:28 unknown kernel[0] <Debug>: [000000.000163]: AppleDPDisplay::terminateLink:(0x81b4a000) Waited 0 ms for display to disable
Jun 1 09:22:28 unknown kernel[0] <Debug>: [000000.000020]: AppleDPDisplay::terminateLink:(0x81b4a000) ret=0x00000000
Jun 1 09:22:28 unknown kernel[0] <Debug>: [000000.000703]: AppleDPDisplay::deviceTerminated:(0x81b4a000) device=0xb4fcd300
Jun 1 09:22:28 unknown kernel[0] <Debug>: [000000.000099]: AppleDPDisplay::setPower:(0x81b4a000) enable=0 ret=0x00000000
Jun 1 09:22:28 unknown kernel[0] <Debug>: [000000.000020]: AppleDPDisplay::setLCDStateGated:(0x81b4a000) enable=0 ret=0x00000000
Jun 1 09:22:29 unknown SpringBoard[15] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=1
Jun 1 09:22:29 unknown UserEventAgent[12] <Warning>: DEBUG: Changing screen blanked state: 0
Jun 1 09:22:29 unknown SpringBoard[15] <Notice>: MultitouchHID: detection mode: 255->0 (deferring until bootloaded)
Jun 1 09:22:29 unknown SpringBoard[15] <Notice>: MultitouchHID: device bootloaded
Jun 1 09:22:29 unknown SpringBoard[15] <Notice>: MultitouchHID: detection mode: 0->0
Jun 1 09:22:29 unknown kernel[0] <Debug>: set_crc_notification_state 0
Jun 1 09:22:29 unknown kernel[0] <Debug>: [000001.383400]: AppleDPDisplay::setLCDStateGated:(0x81b4a000) Enabling
Jun 1 09:22:29 unknown kernel[0] <Debug>: [000000.001806]: AppleDPDisplay::setPower:(0x81b4a000) setting bl deadline for 193 ms from now
Jun 1 09:22:29 unknown kernel[0] <Debug>: [000000.000027]: AppleDPDisplay::setPower:(0x81b4a000) enable=1 ret=0x00000000
Jun 1 09:22:29 unknown kernel[0] <Debug>: [000000.000018]: AppleDPDisplay::setLCDStateGated:(0x81b4a000) enable=1 ret=0x00000000
Jun 1 09:22:30 unknown kernel[0] <Debug>: [000000.052701]: AppleDPDisplay::devicePublished:(0x81b4a000) newDevice=0x8d3ee000
Jun 1 09:22:30 unknown kernel[0] <Debug>: [000000.023734]: AppleDPDisplay::trainLink:(0x81b4a000) Waited 23 ms for link training
Jun 1 09:22:30 unknown kernel[0] <Debug>: [000000.000174]: AppleDPDisplay::initiateLink:(0x81b4a000) Waited 78 ms for display to enable
Jun 1 09:22:30 unknown kernel[0] <Debug>: [000000.000020]: AppleDPDisplay::initiateLink:(0x81b4a000) _dpDevice=0x8d3ee000 ret=0x00000000
Jun 1 09:22:37 unknown ReportCrash[9152] <Notice>: Formulating crash report for process XYZ[9143]
Jun 1 09:22:37 unknown ReportCrash[9152] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/XYZ_2012-06-01-092237_The-new-iPad.plist using uid:
0 gid: 0, synthetic_euid: 501 egid: 0
Jun 1 09:22:37 unknown com.apple.launchd[1] <Warning>:
(UIKitApplication:com.company.test[0xe951]) Job appears to have crashed: Segmentation fault: 11
Jun 1 09:22:37 unknown SpringBoard[15] <Warning>: Application 'XYZ' exited abnormally with signal 11: Segmentation fault: 11
Can anyone here read this and hint me towards some solution or work arounds ??
Try add a NSZombieEnabled. For to do this:
1) Press cmd + Shift + ,
2) In left panel click a "Run {app name}"
3) At right choose Diagnostics"
4) Set checkbox at "Enable Zombie Objects"
5) Retry a crash, then you can debug a error with XCode

iOS app crash on locale change

When I leave my app, goto the settings and changes the language on the phone, my app (still resident in the background) crashes.
Is there an interface or something that I should be implementing or is this expected behaviour?
The code that I'm using is very simple, really just one xib, localized to english and french.
There is no crash log that is product, but the console outputs the following:
May 29 12:08:30 unknown SpringBoard[1723] <Warning>: Killing <SBApplication: 0x1f57d320> com.MightyZeppelin.LocalizediPhone activate: deactivate: for app installation
May 29 12:08:31 unknown SpringBoard[1723] <Warning>: Reloading application state for 'com.MightyZeppelin.LocalizediPhone' as its modification date has changed
May 29 12:08:32 unknown SpringBoard[1723] <Warning>: Reloading and rendering all application icons.
May 29 12:08:35 unknown com.apple.debugserver-50[1755] <Warning>: debugserver-50 for armv6 Copyright (c) 2007-2009 Apple, Inc. All Rights Reserved.
May 29 12:08:35 unknown com.apple.debugserver-50[1755] <Warning>: Connecting to com.apple.debugserver service...
May 29 12:08:35 unknown kernel[0] <Debug>: lockbot[1747] Builtin profile: debugserver (sandbox)
May 29 12:08:35 unknown SpringBoard[1723] <Notice>: MultitouchHID(1f513310) uilock state: 1 -> 0
May 29 12:08:35 unknown MobileStorageMounter[1756] <Notice>: (0x3f4dd48c) platform_supports_camera_import: Platform is NOT configured for camera import
May 29 12:08:36 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Spawned and waiting for the debugger to attach before continuing...
May 29 12:08:36 unknown com.apple.debugserver-50[1755] <Warning>: Got a connection, waiting for debugger instructions for task "(null)".
May 29 12:08:36 unknown kernel[0] <Debug>: launchd[1757] Builtin profile: container (sandbox)
May 29 12:08:36 unknown kernel[0] <Debug>: launchd[1757] Container: /private/var/mobile/Applications/D0AA4DB0-9D85-4C7B-84EF-938C8C8DC952 [69] (sandbox)
May 29 12:08:45 unknown MobileStorageMounter[1756] <Notice>: (0x3f4dd48c) idle_timer_callback: Exiting after idle timeout
May 29 12:08:54 unknown Preferences[1758] <Warning>: BTM: attaching to BTServer
May 29 12:08:55 unknown Preferences[1758] <Warning>: BTM: posting notification BluetoothAvailabilityChangedNotification
May 29 12:09:04 unknown com.apple.SpringBoard[1723] <Notice>: CoreAnimation: timed out fence 5
May 29 12:09:05 unknown SpringBoard[1723] <Warning>: Preferred language has changed from 'en' to 'fr'. Relaunching.
May 29 12:09:05 unknown com.apple.launchd[1] <Warning>: (com.apple.mediaserverd) Exited with exit code: 254
May 29 12:09:05 unknown kernel[0] <Debug>: launchd[1760] Builtin profile: iapd (sandbox)
May 29 12:09:09 unknown MobileMusicPlayer[1766] <Warning>: ITDBPrepServerPostProcessRun: [BEGIN] looking up itdbprepserver.
May 29 12:09:09 unknown itdbprepserver[1767] <Warning>: starting up.
May 29 12:09:09 unknown itdbprepserver[1767] <Warning>: acquired iTunes sync file lock.
May 29 12:09:09 unknown itdbprepserver[1767] <Warning>: acquired itdbprep file lock.
May 29 12:09:09 unknown itdbprepserver[1767] <Warning>: posting com.apple.itdbprep.notification.willBegin
May 29 12:09:10 unknown MobileMusicPlayer[1766] <Warning>: ITDBPrepServerPostProcessRun: [-END-] looking up itdbprepserver. success = 1
May 29 12:09:10 unknown itdbprepserver[1767] <Warning>: BEGIN processing command: com.apple.itdprep.command.runPostProcess
May 29 12:09:10 unknown MobileMusicPlayer[1766] <Warning>: *** MLSSqliteVFS AllWrites DISABLED ***
May 29 12:09:10 unknown itdbprepserver[1767] <Warning>: [BEGIN] ITDBPostProcessController...
May 29 12:09:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobileipod[0x83e4]) Exited: Killed: 9
May 29 12:09:12 unknown kernel[0] <Debug>: IOReturn IOMobileFramebufferUserClient::set_hotplug_notify(void*, void*) 0 0
May 29 12:09:12 unknown kernel[0] <Debug>: IOReturn IOMobileFramebufferUserClient::set_hotplug_notify(void*, void*) 0 0
May 29 12:09:13 unknown SpringBoard[1770] <Error>: WiFi: Consulting "no-sdio-devices" property.
May 29 12:09:13 unknown SpringBoard[1770] <Error>: WiFi: "no-sdio-devices" property not found.
May 29 12:09:13 unknown SpringBoard[1770] <Warning>: lockdown says the device is: [WildcardActivated], state is 3
May 29 12:09:13 unknown SpringBoard[1770] <Warning>: lockdown says we've previously registered: [1], state is 1
May 29 12:09:13 unknown SpringBoard[1770] <Notice>: CLTM: initial thermal level is 0
May 29 12:09:13 unknown SpringBoard[1770] <Notice>: MultitouchHID(1dd35200) uilock state: 1 -> 0
May 29 12:09:13 unknown locationd[22] <Error>: hidd died. Reestablishing connection.
May 29 12:09:14 unknown misd[1771] <Notice>: port forwarding is allowed
May 29 12:09:14 unknown misd[1771] <Info>: checking for carrier provisioning
May 29 12:09:14 unknown misd[1771] <Info>: carrier service is available
May 29 12:09:14 unknown misd[1771] <Debug>: published changes: success
May 29 12:09:14 unknown misd[1771] <Info>: maximum number of wireless tethered hosts is 5
May 29 12:09:14 unknown misd[1771] <Debug>: published changes: success
May 29 12:09:14 unknown misd[1771] <Debug>: attached to SpringBoard (0x1ed31140, port 0x3f0b)
May 29 12:09:14 unknown misd[1771] <Debug>: detached from SpringBoard (0x1ed31140, port 0x1ed31180)
May 29 12:09:14 unknown misd[1771] <Debug>: no clients left; resuming idle timer
May 29 12:09:14 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Exit timeout elapsed (1 seconds). Killing
May 29 12:09:17 unknown SpringBoard[1770] <Warning>: BTM: attaching to BTServer
May 29 12:09:19 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Did not die after sending SIGKILL 5 seconds ago...
May 29 12:09:21 unknown SpringBoard[1770] <Warning>: ITDBPrepServerPostProcessRun: [BEGIN] looking up itdbprepserver.
May 29 12:09:21 unknown itdbprepserver[1767] <Warning>: CPDistributedMessagingCenter ignoring message named com.apple.itdprep.command.runPostProcess since no target and selector are registered
May 29 12:09:21 unknown SpringBoard[1770] <Warning>: ITDBPrepServerPostProcessRun: [-END-] looking up itdbprepserver. success = 0
May 29 12:09:23 unknown com.apple.launchd[1] <Warning>: (com.apple.AddressBook) Throttling respawn: Will start in 10 seconds
May 29 12:09:24 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Did not die after sending SIGKILL 10 seconds ago...
May 29 12:09:25 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Bug: launchd_core_logic.c:3794 (24506):3
May 29 12:09:25 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Bug: launchd_core_logic.c:3202 (24506):10
May 29 12:09:25 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.MightyZeppelin.LocalizediPhone[0x47f]) Working around 5020256. Assuming the job crashed.
May 29 12:09:28 unknown MobileStorageMounter[1775] <Notice>: (0x3f4dd48c) platform_supports_camera_import: Platform is NOT configured for camera import
May 29 12:09:28 unknown SpringBoard[1770] <Warning>: Could not find mapped image Black_CARRIER_FIDO.png
May 29 12:09:28 unknown SpringBoard[1770] <Debug>: spd:_libspd_initialize_protocol:142 Registered notification port with spd [PID=1776]
May 29 12:09:28 unknown SpringBoard[1770] <Debug>: spd:_libspd_initialize_notify:241 All set up for spd wake notifications
May 29 12:09:29 unknown misd[1771] <Debug>: attached to SpringBoard (0x1ed30f30, port 0x3f17)
May 29 12:09:29 unknown misd[1771] <Debug>: detached from SpringBoard (0x1ed30f30, port 0x1ed30f70)
May 29 12:09:29 unknown misd[1771] <Debug>: no clients left; resuming idle timer
May 29 12:09:29 unknown SpringBoard[1770] <Warning>: BTM: posting notification BluetoothAvailabilityChangedNotification
May 29 12:09:30 unknown com.apple.printd[1777] <Notice>: Accepted connection from localhost:631 (Domain)
May 29 12:09:30 unknown com.apple.printd[1777] <Notice>: Closing connection from localhost:631 (Domain)
May 29 12:09:30 unknown SpringBoard[1770] <Error>: mms: ***** isMmsConfigured = 1
May 29 12:09:30 unknown SpringBoard[1770] <Warning>: BTM: BTLocalDeviceGetPairedDevices returned 0 devices
May 29 12:09:30 unknown com.apple.printd[1777] <Notice>: Accepted connection from localhost:631 (Domain)
May 29 12:09:30 unknown searchd[1779] <Warning>: Opened updates file at /var/mobile/Library/Spotlight/com.apple.MobileSMS/updates.SMSSearch.spotlight
May 29 12:09:30 unknown SpringBoard[1770] <Error>: WiFi: Consulting "no-sdio-devices" property.
May 29 12:09:30 unknown SpringBoard[1770] <Error>: WiFi: "no-sdio-devices" property not found.
May 29 12:09:31 unknown com.apple.printd[1777] <Notice>: Closing connection from localhost:631 (Domain)
May 29 12:09:32 unknown MobilePhone[1782] <Warning>: UI Mode is Phone
May 29 12:09:33 unknown com.apple.launchd[1] <Warning>: (com.apple.AddressBook) Throttling respawn: Will start in 10 seconds
May 29 12:09:33 unknown itdbprepserver[1767] <Warning>: Running Misc Commands...
May 29 12:09:33 unknown itdbprepserver[1767] <Warning>: Running Create Triggers...
May 29 12:09:33 unknown itdbprepserver[1767] <Warning>: Initializing MusicLibrary...
May 29 12:09:33 unknown itdbprepserver[1767] <Warning>: *** STARTING: DB Backup (CREATE-NEW) ***
May 29 12:09:33 unknown itdbprepserver[1767] <Warning>: *** FINISHED: DB Backup (CREATE-NEW, time = 0.13s) ***
May 29 12:09:33 unknown itdbprepserver[1767] <Warning>: [-END-] ITDBPostProcessController.
In all likelihood, the app probably doesn't crash. It gets killed by the operating system.
This is indeed expected behavior. All apps are killed on a language change, both on simulator and device.

App is Crashing on iPod Touch First and Second Generation

My released app (Hidden London - Free App) has been reported as crashing on iPod touch 2nd and 3rd Generation. It works without issue on iPhone and iPad.
The crash log is as follows:
Wed Apr 13 09:03:40 unknown kernel[0] <Debug>: launchd[908] Builtin profile: container (sandbox)
Wed Apr 13 09:03:40 unknown kernel[0] <Debug>: launchd[908] Container: /private/var/mobile/Applications/E509FC07-A742-4483-95B1-7393B3F129B9 [69] (sandbox)
Wed Apr 13 09:03:40 unknown sandboxd[911] <Notice>: HiddenLondon(908) deny file-write-data /private/var/mobile/Applications/E509FC07-A742-4483-95B1-7393B3F129B9/HiddenLondon.app/HiddenLondon.sqlite
Wed Apr 13 09:03:40 unknown HiddenLondon[908] <Warning>: Not purchased: com.Beutelkind.HiddenLondon.ExtraPlaces
Wed Apr 13 09:03:40 unknown HiddenLondon[908] <Warning>: Not purchased: com.Beutelkind.HiddenLondon.RemoveAds
Wed Apr 13 09:03:42 unknown securityd[910] <Error>: OCSPResponse: now + maxAge > latestNextUpdate, using latestNextUpdate
Wed Apr 13 09:03:42 unknown com.apple.SpringBoard[24] <Notice>: CoreAnimation: timed out fence 500
Wed Apr 13 09:04:00 unknown HiddenLondon[908] <Warning>: ADBannerView: WARNING A banner view (0x159470) has an ad but may be obscured. This message is only printed once per banner view.
Wed Apr 13 09:04:31 unknown configd[22] <Notice>: jetsam: kernel memory event (90), free: 323, active: 1250, inactive: 1494, purgeable: 0, wired: 7841
Wed Apr 13 09:04:31 unknown configd[22] <Notice>: jetsam: kernel termination snapshot being created
Wed Apr 13 09:04:31 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.AdSheetPhone[0xabc0]) Exited: Killed
Wed Apr 13 09:04:31 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.Beutelkind.HiddenLondon[0x2fef]) Exited: Killed
Wed Apr 13 09:04:31 unknown SpringBoard[24] <Warning>: Received memory warning. Level=1
Wed Apr 13 09:04:31 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilemail[0x736e]) Exited: Killed
Wed Apr 13 09:04:31 unknown SpringBoard[24] <Warning>: Received memory warning. Level=1
Wed Apr 13 09:04:32 unknown SpringBoard[24] <Warning>: Application 'AdSheet' exited abnormally with signal 9: Killed
Wed Apr 13 09:04:32 unknown SpringBoard[24] <Warning>: Application 'HiddenLondon' exited abnormally with signal 9: Killed
Wed Apr 13 09:04:32 unknown SpringBoard[24] <Warning>: Application 'Mail' exited abnormally with signal 9: Killed
Wed Apr 13 09:04:32 unknown SpringBoard[24] <Warning>: Memory level is not normal (56%). Delaying auto-relaunch of 'Mail' for 30 seconds.
Wed Apr 13 09:04:32 unknown SpringBoard[24] <Warning>: Received memory warning. Level=1
Wed Apr 13 09:04:33 unknown ReportCrash[917] <Error>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2011-04-13-090433.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Could anyone help me start to troubleshoot why this might be happening on the iPod Touch?
The hint to why your app is crashing is Received memory warning. Level=1. You're out of memory. This could be the amount of RAM your app is using for data structures, but I've more typically seen this type of error when you run out of graphics memory - i.e. the memory used to composite views, cache images, etc. The total amount of RAM on gen 1 and 2 iPod touches is only 128MB. Gen 3 and 4 bumped that to 256MB.
The memory related info in your log starts with jetsam: kernel memory event (90), free: 323, active: 1250, inactive: 1494, purgeable: 0, wired: 7841, which is a "low memory" warning message. You then see a whole bunch of apps being terminated by the OS (Exited: Killed and exited abnormally with signal 9: Killed). This is the documented behaviour of iOS in low memory conditions - it kills apps until it has enough free memory.
I believe that your application is using a lot of memory, and as a result it gets killed by the operating system.

iPhone universal app. MoviePlayer.framwork problem

I have application based on 3.0 iPhone OS SDK
One of tasks is playing video (I use MPMoviePlayerController for this task)
Now I try to make universal app working on both 3.0 and 3.2 OS
I did all steps described in apple documentation: Upgrade Current Target for iPad; make run-time checking for symbols using
[[UIDevice currentDevice] respondsToSelector:#selector(userInterfaceIdiom)]
function. But when I start my application on device - iPhone with OS 3.1.3 my apllication is crashes with next log:
Tue May 25 18:00:28 unknown SpringBoard[24] <Notice>: MultitouchHID(208b30) uilock state: 1 -> 0
Tue May 25 18:00:29 unknown SpringBoard[24] <Notice>: MultitouchHID(292580) device bootloaded
Tue May 25 18:00:34 unknown UIKitApplication:...[0xaa0f][1517] <Notice>: dyld: Symbol not found: _MPMoviePlayerWillEnterFullscreenNotification
Tue May 25 18:00:34 unknown UIKitApplication:...[0xaa0f][1517] <Notice>: Referenced from: /var/mobile/Applications/876EA35E-5756-436B-A9E2-5481D4D62050/....app/...
Tue May 25 18:00:34 unknown UIKitApplication:...[0xaa0f][1517] <Notice>: Expected in: /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
Tue May 25 18:00:35 unknown kernel[0] <Debug>: launchd[1517] Builtin profile: container (seatbelt)
Tue May 25 18:00:35 unknown kernel[0] <Debug>: launchd[1517] Container: /private/var/mobile/Applications/876EA35E-5756-436B-A9E2-5481D4D62050 (seatbelt)
Tue May 25 18:00:35 unknown ReportCrash[1518] <Notice>: Formulating crash report for process cnetmobile[1517]
Tue May 25 18:00:36 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:...[0xaa0f]) Job appears to have crashed: Trace/BPT trap
Tue May 25 18:00:36 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:...[0xaa0f]) Throttling respawn: Will start in 2147483646 seconds
Tue May 25 18:00:36 unknown SpringBoard[24] <Warning>: Application '...' exited abnormally with signal 5: Trace/BPT trap
Tue May 25 18:00:36 unknown ReportCrash[1518] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/..._2010-05-25-180034_...-iPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Tue May 25 18:01:36 unknown SpringBoard[24] <Notice>: MultitouchHID(208b30) uilock state: 0 -> 1
As you can see the error is "Symbol not found: _MPMoviePlayerWillEnterFullscreenNotification". This symbol is notification available in MediaPlayer.framework starting from iPhone OS 3.2
So, what am I doing wrong? What I should do to have universal application working correct on OS 3.2 (with new available functionality) and older OSes (with their functionality)?
The content of that constant is the string #"MPMoviePlayerWillEnterFullscreenNotification", so you can use this string in place of the constant.
Alternatively, you could
use functions like dlsym to get the symbol at runtime; or
make that symbol weakly linked (= doing step 1 automatically)
It's MediaPlay.framework not added.