I'm in the midst of submitting my first app so I'm definitely still learning alot as I go along. I just received the app rejection note that my app:
We found that your app crashed on iPhone 5 running iOS 6.1.4 Your app crashed when the alarm was supposed to ring.
This occurred when your app was used:
I attached the crash report here and I hope someone might be able to help on how I might go about fixing this!! It works fine on all other versions and unfortunately I dont have an iPhone5 6.1.4 to test this on so never noticed it!! Thinking if it has something to do with the CFRunLoop?
Thanks!
Incident Identifier: 813F546D-237B-4761-BCE4-85EF4A21AEA1
CrashReporter Key: faf5c17d0c159e839c86919af387d69d056f9fe5
Hardware Model: xxx
Process: Torchie [11845]
Path: /var/mobile/Applications/B2291BEB-8F50-43D8-BC90-7292ACB17362/Torchie.app/Torchie
Identifier: Torchie
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2013-08-06 14:28:00.238 -0700
OS Version: iOS 6.1.3 (10B329)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x32bf129e __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3aa9597a objc_exception_throw + 26
2 AVFoundation 0x31d76d36 -[AVCaptureFigVideoDevice setTorchModeOnWithLevel:error:] + 130
3 Torchie 0x00098184 -[TorchieViewController torch:] (TorchieViewController.m:181)
4 Torchie 0x00098756 -[TorchieViewController ringFlash] (TorchieViewController.m:275)
5 Foundation 0x33508f4e __NSFireTimer + 58
6 CoreFoundation 0x32bc65da __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 10
7 CoreFoundation 0x32bc628c __CFRunLoopDoTimer + 268
8 CoreFoundation 0x32bc4efc __CFRunLoopRun + 1228
9 CoreFoundation 0x32b37eb8 0x32b2f000 + 36536
10 CoreFoundation 0x32b37d44 0x32b2f000 + 36164
11 GraphicsServices 0x366ec2e6 0x366e7000 + 21222
12 UIKit 0x34a4d2fc UIApplicationMain + 1116
13 Torchie 0x00097026 main (main.m:16)
14 Torchie 0x00096fdc start + 36
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3af93350 __pthread_kill + 8
1 libsystem_c.dylib 0x3af0a11e pthread_kill + 54
2 libsystem_c.dylib 0x3af4696e abort + 90
3 libc++abi.dylib 0x3a4e4d4a abort_message + 70
4 libc++abi.dylib 0x3a4e1ff4 default_terminate() + 20
5 libobjc.A.dylib 0x3aa95a74 _objc_terminate() + 144
6 libc++abi.dylib 0x3a4e2078 safe_handler_caller(void (*)()) + 76
7 libc++abi.dylib 0x3a4e2110 std::terminate() + 16
8 libc++abi.dylib 0x3a4e3594 __cxa_rethrow + 84
9 libobjc.A.dylib 0x3aa959cc objc_exception_rethrow + 8
10 CoreFoundation 0x32b37f1c CFRunLoopRunSpecific + 452
11 CoreFoundation 0x32b37d44 CFRunLoopRunInMode + 100
12 GraphicsServices 0x366ec2e6 GSEventRunModal + 70
13 UIKit 0x34a4d2fc UIApplicationMain + 1116
14 Torchie 0x00097026 main (main.m:16)
15 Torchie 0x00096fdc start + 36
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0 libsystem_kernel.dylib 0x3af83648 kevent64 + 24
1 libdispatch.dylib 0x3aeb3974 _dispatch_mgr_invoke + 792
2 libdispatch.dylib 0x3aeb3654 _dispatch_mgr_thread$VARIANT$mp + 32
Thread 2:
0 libsystem_kernel.dylib 0x3af93d98 __workq_kernreturn + 8
1 libsystem_c.dylib 0x3aee1cf6 _pthread_workq_return + 14
2 libsystem_c.dylib 0x3aee1a12 _pthread_wqthread + 362
3 libsystem_c.dylib 0x3aee18a0 start_wqthread + 4
Thread 3 name: WebThread
Thread 3:
0 libsystem_kernel.dylib 0x3af82eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3af83048 mach_msg + 36
2 CoreFoundation 0x32bc6040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x32bc4d9e __CFRunLoopRun + 878
4 CoreFoundation 0x32b37eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x32b37d44 CFRunLoopRunInMode + 100
6 WebCore 0x38b27500 RunWebThread(void*) + 440
7 libsystem_c.dylib 0x3aeec30e _pthread_start + 306
8 libsystem_c.dylib 0x3aeec1d4 thread_start + 4
Thread 4 name: com.apple.coremedia.player.async
Thread 4:
0 libsystem_kernel.dylib 0x3af9308c __psynch_cvwait + 24
1 libsystem_c.dylib 0x3aee4d2a _pthread_cond_wait + 642
2 libsystem_c.dylib 0x3aeeef14 pthread_cond_wait + 36
3 CoreMedia 0x3311d8ac FigSemaphoreWaitRelative + 256
4 MediaToolbox 0x33c0fe56 fpa_AsyncMovieControlThread + 22
5 CoreMedia 0x3313b890 figThreadMain + 192
6 libsystem_c.dylib 0x3aeec30e _pthread_start + 306
7 libsystem_c.dylib 0x3aeec1d4 thread_start + 4
Thread 5 name: AQClient
Thread 5:
0 libsystem_kernel.dylib 0x3af82eb4 mach_msg_trap + 20
1 libsystem_kernel.dylib 0x3af83048 mach_msg + 36
2 CoreFoundation 0x32bc6040 __CFRunLoopServiceMachPort + 124
3 CoreFoundation 0x32bc4d9e __CFRunLoopRun + 878
4 CoreFoundation 0x32b37eb8 CFRunLoopRunSpecific + 352
5 CoreFoundation 0x32b37d44 CFRunLoopRunInMode + 100
6 AudioToolbox 0x326196fe GenericRunLoopThread::Entry(void*) + 134
7 AudioToolbox 0x325fa882 CAPThread::Entry(CAPThread*) + 294
8 libsystem_c.dylib 0x3aeec30e _pthread_start + 306
9 libsystem_c.dylib 0x3aeec1d4 thread_start + 4
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x3ca89534
r4: 0x00000006 r5: 0x3ca89b88 r6: 0x1e5953b4 r7: 0x2fd6ba24
r8: 0x1e595390 r9: 0x00000300 r10: 0x1f067260 r11: 0x1f05aa30
ip: 0x00000148 sp: 0x2fd6ba18 lr: 0x3af0a123 pc: 0x3af93350
cpsr: 0x00000010
Binary Images:
0x95000 - 0xa1fff +Torchie armv7 <0bfcf99566bf341b8b76e2eea17e15e6> /var/mobile/Applications/B2291BEB-8F50-43D8-BC90-7292ACB17362/Torchie.app/Torchie
0x2fe7b000 - 0x2fe9b75b dyld armv7 <280610df5ed43ec7aa00629a27009302> /usr/lib/dyld
0x31d12000 - 0x31df8fff AVFoundation armv7 <320761e836883aeabf3cb5c53edb636d> /System/Library/Frameworks/AVFoundation.framework/AVFoundation
0x31df9000 - 0x31df9fff Accelerate armv7 <b68ff92e404931f3bcb6361720f77724> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x31dfa000 - 0x31f38ff3 vImage armv7 <30522b92940d3dd184c8e46780594048> /System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage
0x31f39000 - 0x3201cff7 libBLAS.dylib armv7 <d8edada1cea133458ca779e34a3a7f88> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x3201d000 - 0x322d2fff libLAPACK.dylib armv7 <9e08aead79d13043bab622402a270fba> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x322d3000 - 0x3232cff3 libvDSP.dylib armv7 <09e2a5e3e9203950890ba57592523132> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x3232d000 - 0x3233efff libvMisc.dylib armv7 <7b7d4ccc9f2b364cb0da4251e745545d> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvMisc.dylib
0x3233f000 - 0x3233ffff vecLib armv7 <a7751c047dcc35ba8885212e1938b93f> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x32340000 - 0x32351ffe Accounts armv7 <ea2de358b6cc3baab27d6ab809c31e39> /System/Library/Frameworks/Accounts.framework/Accounts
0x32353000 - 0x323b7ffb AddressBook armv7 <8cfae84dc66d3c1f9d17335c53c3d7b7> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x323b8000 - 0x32472fff AddressBookUI armv7 <0017d0a0c2593522acaaa0eee41775e4> /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI
0x32473000 - 0x32481ffc AssetsLibrary armv7 <9a3a4a47a77833eb82a28757a3488660> /System/Library/Frameworks/AssetsLibrary.framework/AssetsLibrary
0x325bd000 - 0x32845ff7 AudioToolbox armv7 <394ee11cf826367db9ff4968dbc71d6d> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x32846000 - 0x3290bff7 CFNetwork armv7 <4771a5e4f9b83bceb252f0f3d166aaca> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x3290c000 - 0x32962ff8 CoreAudio armv7 <5d534dbf76ff30f4a628f25f56c5f26a> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x32976000 - 0x32b2e49f CoreData armv7 <3930f672c76535a2abb768ee59958fa7> /System/Library/Frameworks/CoreData.framework/CoreData
0x32b2f000 - 0x32c61ff1 CoreFoundation armv7 <fcb8d4e838543bcb9a52c9f232b8b4eb> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x32c62000 - 0x32d9afff CoreGraphics armv7 <81e213f810a034d4ba411f9b505da2a6> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x32d9c000 - 0x32dd7ff0 libCGFreetype.A.dylib armv7 <a5d20b80ab1532d8831027a66d2d9eb5> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x32fbb000 - 0x32fd6ffb libRIP.A.dylib armv7 <ec1487f9bdb93597a3f8d434406ad9bf> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x32fd7000 - 0x3308cff2 CoreImage armv7 <6ae4ae2461313e3f84c6a8102d5b1b0e> /System/Library/Frameworks/CoreImage.framework/CoreImage
0x3308d000 - 0x330e5ff7 CoreLocation armv7 <4edb4b0f05e13af8b84699fe3ea4c538> /System/Library/Frameworks/CoreLocation.framework/CoreLocation
0x3311a000 - 0x3317fff2 CoreMedia armv7 <8592bdc268b83b8886acfc1fdab649ed> /System/Library/Frameworks/CoreMedia.framework/CoreMedia
0x33180000 - 0x33208ff3 CoreMotion armv7 <4512d901170d32e7842e7fc1c519386b> /System/Library/Frameworks/CoreMotion.framework/CoreMotion
0x33209000 - 0x3325fffb CoreTelephony armv7 <bea09dbe25363c3b8e8016b5b5148055> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x33260000 - 0x332c2fff CoreText armv7 <e135debbc8f937299f4986fc3e9459e3> /System/Library/Frameworks/CoreText.framework/CoreText
0x332c3000 - 0x332d2fff CoreVideo armv7 <00f18bb26e663da9ae251a6ec36a19ec> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x332d3000 - 0x33387fff EventKit armv7 <99a7a1603323319f9e24f97e9f89bfd3> /System/Library/Frameworks/EventKit.framework/EventKit
0x33457000 - 0x3361affd Foundation armv7 <0179934581d13346aa7583165108b95c> /System/Library/Frameworks/Foundation.framework/Foundation
0x337d5000 - 0x3381efff IOKit armv7 <a98ba9fefc7333e4a5a9169198848c62> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x3381f000 - 0x339f7ffb ImageIO armv7 <b5ce84bb074d3de4b07b55da9fd8bfd1> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x33a71000 - 0x33c0bfff MediaPlayer armv7 <ce97a30e514d3a17ae93ba4a9d1d69d2> /System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
0x33c0c000 - 0x33e86ff7 MediaToolbox armv7 <ed439fc5c9a03f8b9fae43af33de8a57> /System/Library/Frameworks/MediaToolbox.framework/MediaToolbox
0x33e87000 - 0x33f0dfff MessageUI armv7 <8dbc0a8e6a253c8c8d6301064f23dfea> /System/Library/Frameworks/MessageUI.framework/MessageUI
0x33f0e000 - 0x33f67ff7 MobileCoreServices armv7 <77da8a9e7f813f5baf37eaa4a87fae84> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
0x34056000 - 0x3405dfff OpenGLES armv7 <f2ede6b206f336de82cc38619692e762> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x3405f000 - 0x3405ffff libCVMSPluginSupport.dylib armv7 <2506af1c983f3f09ac69aca44f67e863> /System/Library/Frameworks/OpenGLES.framework/libCVMSPluginSupport.dylib
0x34063000 - 0x34065ffd libCoreVMClient.dylib armv7 <af6ff28dce6031baaa850ccc79e5699b> /System/Library/Frameworks/OpenGLES.framework/libCoreVMClient.dylib
0x34066000 - 0x3406afff libGFXShared.dylib armv7 <a6ac1673a088379aa512ba5cac301f5b> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x3406b000 - 0x340a8ff9 libGLImage.dylib armv7 <b8b8f3a1bfd0345e86aa0c2952534949> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
0x347a3000 - 0x348b8fff QuartzCore armv7 <c086b6e6cd9d341399bcc3675c82f1fe> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x348b9000 - 0x34906fff QuickLook armv7 <954e3a8bdaf337b085b30fd514ea5f3a> /System/Library/Frameworks/QuickLook.framework/QuickLook
0x34907000 - 0x34935ffc Security armv7 <fbc24f15bd9e37539cdd6e3576bde938> /System/Library/Frameworks/Security.framework/Security
0x34936000 - 0x349a3fff Social armv7 <7b778c6ce3433df18ef0892acd831208> /System/Library/Frameworks/Social.framework/Social
0x349b4000 - 0x349f3fff SystemConfiguration armv7 <410d69b356e533d6a1d538cf33059634> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x349f6000 - 0x34f4aff3 UIKit armv7 <ad8b3ad23f413187a178179db39cfa6b> /System/Library/Frameworks/UIKit.framework/UIKit
0x34f4b000 - 0x34f89ff3 VideoToolbox armv7 <d2e8067306d9346ab4a448f10f336894> /System/Library/Frameworks/VideoToolbox.framework/VideoToolbox
0x351fb000 - 0x35207ffb AccountSettings armv7 <8db45acc4d3d3017af10fa5ee82c2306> /System/Library/PrivateFrameworks/AccountSettings.framework/AccountSettings
0x3524e000 - 0x35251fff ActorKit armv7 <5dfc59258ea63006be9c542e5fafbc45> /System/Library/PrivateFrameworks/ActorKit.framework/ActorKit
0x35253000 - 0x35256ffb AggregateDictionary armv7 <c2a6c1ff89a9318d8b74fc5dfc8847b8> /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
0x3533f000 - 0x35352ff8 AirTraffic armv7 <752b64045f4d3ea88a946b53b731ce1a> /System/Library/PrivateFrameworks/AirTraffic.framework/AirTraffic
0x35682000 - 0x356bdfff AppSupport armv7 <921794b7d82a3558a0eb860979be199c> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x356be000 - 0x356e2ffc AppleAccount armv7 <c54536fbc0f235f693060be33d4d4749> /System/Library/PrivateFrameworks/AppleAccount.framework/AppleAccount
0x356ef000 - 0x356fcffa ApplePushService armv7 <8bad4a9300db3d4d8555535f25c32da4> /System/Library/PrivateFrameworks/ApplePushService.framework/ApplePushService
0x35730000 - 0x35739ffb AssetsLibraryServices armv7 <de7ca29cd47433cd8eca9c04102f5508> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
0x3573a000 - 0x35753ff8 AssistantServices armv7 <9608ae74229e3daeab9c8fcf679de7d4> /System/Library/PrivateFrameworks/AssistantServices.framework/AssistantServices
0x35769000 - 0x35780fff BackBoardServices armv7 <772912697ec23e5199a452e97f075dd9> /System/Library/PrivateFrameworks/BackBoardServices.framework/BackBoardServices
0x3578a000 - 0x357aeff7 Bom armv7 <b5315d733e123a0781683efdc734064b> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x357c1000 - 0x357f0ffb BulletinBoard armv7 <9f46015c5d263064901f7725f4bb93e0> /System/Library/PrivateFrameworks/BulletinBoard.framework/BulletinBoard
0x3582e000 - 0x35835ffa CaptiveNetwork armv7 <a4f4b86cc84839f78ff746f013bcee6f> /System/Library/PrivateFrameworks/CaptiveNetwork.framework/CaptiveNetwork
0x35836000 - 0x35900ffe Celestial armv7 <a688df527b65382da586ebc87f28c061> /System/Library/PrivateFrameworks/Celestial.framework/Celestial
0x3590d000 - 0x35911fff CertUI armv7 <ce979f715cdb3cb5a0f7935f14cc0b35> /System/Library/PrivateFrameworks/CertUI.framework/CertUI
0x359b7000 - 0x359d0ff9 ChunkingLibrary armv7 <ec2f76b3ac723a39bbf3f122d7fe73cf> /System/Library/PrivateFrameworks/ChunkingLibrary.framework/ChunkingLibrary
0x359e4000 - 0x359e9fff CommonUtilities armv7 <f8fea9ee6ca236b0a7fa6c00eb8a0d24> /System/Library/PrivateFrameworks/CommonUtilities.framework/CommonUtilities
0x35a6e000 - 0x35a9eff5 ContentIndex armv7 <00ed488e47ee34ca9f01f2cc911f453c> /System/Library/PrivateFrameworks/ContentIndex.framework/ContentIndex
0x35b1a000 - 0x35c02ffe CoreMediaStream armv7 <828bf27fe7a3337cbff7dd8837508819> /System/Library/PrivateFrameworks/CoreMediaStream.framework/CoreMediaStream
0x35caf000 - 0x35cb0ffd CoreSurface armv7 <6065f7e040e93d6ea2837e929592cc30> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x35d18000 - 0x35d1cffc CoreTime armv7 <5f0b123555f03d8aa76cc54314907942> /System/Library/PrivateFrameworks/CoreTime.framework/CoreTime
0x35d1d000 - 0x35d22fff CrashReporterSupport armv7 <03ee46e3ca3f3920a7174e62096723fb> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/CrashReporterSupport
0x35d23000 - 0x35d5fffb DataAccess armv7 <d7185042adf63908ae87fe4a5c3f8a6c> /System/Library/PrivateFrameworks/DataAccess.framework/DataAccess
0x35ef4000 - 0x35f06fff DataAccessExpress armv7 <b9423867a9ef303b87d2e1eac1712957> /System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
0x35f45000 - 0x35f46ffc DataMigration armv7 <5903e08348b83f119022cbbf83ad100a> /System/Library/PrivateFrameworks/DataMigration.framework/DataMigration
0x35f49000 - 0x35f62ff9 DictionaryServices armv7 <84669055e3e63d6ab56b8fe7b0476aaa> /System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices
0x35f6a000 - 0x35f82ff4 EAP8021X armv7 <6d5ab53850e23fe389e64e2705bd7810> /System/Library/PrivateFrameworks/EAP8021X.framework/EAP8021X
0x35f92000 - 0x35f96fff FTClientServices armv7 <6354e5b30919340db3b976312b284fce> /System/Library/PrivateFrameworks/FTClientServices.framework/FTClientServices
0x35f97000 - 0x35fd4fff FTServices armv7 <89c066d12a6031038a9b8c61221abc0a> /System/Library/PrivateFrameworks/FTServices.framework/FTServices
0x35fd5000 - 0x363e8ffd FaceCoreLight armv7 <43de0b31da3b39e4acf85ec2c8d5c65c> /System/Library/PrivateFrameworks/FaceCoreLight.framework/FaceCoreLight
0x365e0000 - 0x365ecffe GenerationalStorage armv7 <d77ad2367fff37d485480aa39df7d325> /System/Library/PrivateFrameworks/GenerationalStorage.framework/GenerationalStorage
0x365ed000 - 0x366e6fff GeoServices armv7 <edbf37a31a6a31f49e392ed8ece200c7> /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
0x366e7000 - 0x366f2fff GraphicsServices armv7 <d4b7fd6509753bff9525fef374ddc359> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x36761000 - 0x367dcfff HomeSharing armv7 <280b77b71df23f1cb5c9a2b76fc53212> /System/Library/PrivateFrameworks/HomeSharing.framework/HomeSharing
0x367dd000 - 0x367e7ffd IAP armv7 <a9554a91bbb9308f96fcd9fddf596275> /System/Library/PrivateFrameworks/IAP.framework/IAP
0x3689f000 - 0x36917fff IMCore armv7 <d5f1d98ec53d3acbb51b116e93923d9c> /System/Library/PrivateFrameworks/IMCore.framework/IMCore
0x369de000 - 0x36a2afff IMFoundation armv7 <797535fc363c3f818bcd1424251393bf> /System/Library/PrivateFrameworks/IMFoundation.framework/IMFoundation
0x36a31000 - 0x36a32ffc IOAccelerator armv7 <9655464326203d258d3d0fc7e94651e2> /System/Library/PrivateFrameworks/IOAccelerator.framework/IOAccelerator
0x36a33000 - 0x36a38ffa IOMobileFramebuffer armv7 <f38c374982a931d5a47458dd3c34ac59>
This is the last method in my code before the crash:
-(void)torch:(BOOL)isOn {
torchIsOn = isOn;
[self strobeOff];
[device lockForConfiguration:nil];
if (isOn) {
[slider setHidden:NO];
[device setTorchModeOnWithLevel:[slider value] error:nil];
[slider addTarget:self action:@selector(torch:) forControlEvents:UIControlEventValueChanged];
}
else {
[device setTorchMode:NO];
}
[device unlockForConfiguration];
}
Try making these checks in your torch:
method before setting your torch mode.
[device hasTorch]
and [device torchAvailable]
and [device isTorchModeSupported:AVCaptureTorchModeOn]
The torch may not be available for use. This may be causing the crash. Note that [device torchAvailable] is iOS 5 and up.
from the AVCaptureDevice class reference:
Even if the device has a torch, that torch might not be available for use. Thus, you should also check the value of the torchAvailable property before using it.
so your torch: method could look like:
-(void)torch:(BOOL)isOn {
torchIsOn = isOn;
[self strobeOff];
[device lockForConfiguration:nil];
if (isOn && [device hasTorch] && [device torchAvailable] && [device isTorchModeSupported:AVCaptureTorchModeOn]) {
[slider setHidden:NO];
[device setTorchModeOnWithLevel:[slider value] error:nil];
[slider addTarget:self action:@selector(torch:) forControlEvents:UIControlEventValueChanged];
}
else {
[device setTorchMode:NO];
}
[device unlockForConfiguration];
}
User contributions licensed under CC BY-SA 3.0