-1

我有一个问题,我已经编写了我的第一个应用程序,即将完成。

有一个 VC(启动)带有一个按钮,可以将用户带到另一个 VC 中的游戏。
用户可以通过单击第二个 VC 中的按钮返回到第一个(菜单)VC。

在测试过程中,我注意到当点击主页按钮,然后应用程序被买回视图并点击播放按钮时,应用程序崩溃并且设备重新启动。

为了尝试找出原因,我从游戏 VC 中删除了 iAD 和 Games Center。出现同样的问题,但现在只有在重复主页按钮/回到焦点/播放大约 2-3 次之后。

下面是设备控制台,但我是新手,所以我不清楚。

当它崩溃时,它会在崩溃前显示第二个 VB 毫秒或部分显示。

从它可以在线阅读的内容来看,某些内容正在使用大量内存,但我在代码中看不到任何内容(viewdidload 等)。

我运行了分析,只检测到了死存储。

我不能在模拟器上模拟同样的问题,它只发生在设计(iPhone 3)上。我怀疑是因为 Mac 有更多的内存。

当我使用分析仪器时,它不会显示任何内存峰值。

如果您需要任何其他信息,请告诉我。到目前为止,我已经“解决”了很多问题,我迫不及待地想把它带进商店!!

Sep 18 13:08:38 Andys-iPhone mobile_house_arrest[178] <Error>: Max open files: 78
Sep 18 13:08:41 Andys-iPhone installd[53] <Error>: 0x2ff5e000 handle_install: Install of "/var/mobile/Media/PublicStaging/levelword.app" requested by mobile_installation_proxy
Sep 18 13:08:42 Andys-iPhone installd[53] <Error>: 0x2ff5e000 MobileInstallationInstall_Server: Installing app com.margiesparrow.wribble
Sep 18 13:08:42 Andys-iPhone installd[53] <Error>: profile not valid: 0xe8008012
Sep 18 13:08:42 Andys-iPhone installd[53] <Error>: 0x2ff5e000 install_embedded_profile: Could not install embedded profile: 0xe8008012
Sep 18 13:08:43 Andys-iPhone installd[53] <Error>: Sep 18 13:08:43  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Sep 18 13:08:44 Andys-iPhone SpringBoard[76] <Warning>: Killing com.margiesparrow.wribble for termination assertion
Sep 18 13:08:45 Andys-iPhone lsd[86] <Warning>: updating identifier store
Sep 18 13:08:45 Andys-iPhone kernel[0] <Debug>: launchd[181] Builtin profile: syncdefaultsd (sandbox)
Sep 18 13:08:45 Andys-iPhone lsd[86] <Warning>: Attempting to store identifiers file
Sep 18 13:08:45 Andys-iPhone installd[53] <Error>: 0x2ff5e000 MobileInstallationInstall_Server: Staging: 0.45s; Waiting: 0.04s; Installation: 3.22s; LS Sync: 0.01s; Overall: 4.02s
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Warning>: SSSQLiteDatabase: Could not setup database: [14, /var/root/Library/com.apple.itunesstored/kvs.sqlitedb]
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Notice>: 014c4000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/downloaded-apps -> (null)
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Warning>: SSSQLiteDatabase: Could not setup database: [14, /var/root/Library/com.apple.itunesstored/kvs.sqlitedb]
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Notice>: 014c4000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/downloaded-apps -> (null)
Sep 18 13:08:48 Andys-iPhone mobile_assertion_agent[110] <Notice>: service_one_connection: Connection closed for client iTunes.
Sep 18 13:08:53 Andys-iPhone recentsd[186] <Notice>: 0x1dd0cf30|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown
Sep 18 13:08:55 Andys-iPhone installd[53] <Error>: 0x2ff5e000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1e551bc0 [0x3a38a100]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3a3769f4 [0x3a38a100]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1e5a4360 [0x3a38a100]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3a377a44 [0x3a38a100]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1e5a47d0 [0x3a38a100]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3a374794 [0x3a38a100]>{contents = "DTCompiler"}
        5 : <CFString 0x3a376564 [0x3a38a100]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3a377224 [0x3a38a100]>{contents = "DTSDKName"}
        7 : <CFString 0x1e551050 [0x3a38a100]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3a373eb4 [0x3a38a100]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3a37be84 [0x3a38a100]>{contents = "DTXcode"}
        13 : <CFString 0x3a37beb4 [0x3a38a100]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3a379304 [0x3a38a100]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1e54fbb0 [0x3a38a100]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1e5a2180 [0x3a38a100]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3a377e54 [0x3a38a100]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3a37abf4 [0x3a38a100]>{contents = "DTPlatformName"}
        21 : <CFString 0x3a37bc84 [0x3a38a100]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1e5a2010 [0x3a38a100]>{contents = "DTSDKBuild"}
    }
Sep 18 13:08:58 Andys-iPhone installd[53] <Error>: 0x2ffe0000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1e577ba0 [0x3a38a100]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3a3769f4 [0x3a38a100]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1e54fbb0 [0x3a38a100]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3a377a44 [0x3a38a100]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1e553e70 [0x3a38a100]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3a374794 [0x3a38a100]>{contents = "DTCompiler"}
        5 : <CFString 0x3a376564 [0x3a38a100]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3a377224 [0x3a38a100]>{contents = "DTSDKName"}
        7 : <CFString 0x1e59f6c0 [0x3a38a100]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3a373eb4 [0x3a38a100]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3a37be84 [0x3a38a100]>{contents = "DTXcode"}
        13 : <CFString 0x3a37beb4 [0x3a38a100]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3a379304 [0x3a38a100]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1e59fb10 [0x3a38a100]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1e5a2480 [0x3a38a100]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3a377e54 [0x3a38a100]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3a37abf4 [0x3a38a100]>{contents = "DTPlatformName"}
        21 : <CFString 0x3a37bc84 [0x3a38a100]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1e5a4360 [0x3a38a100]>{contents = "DTSDKBuild"}
    }
Sep 18 13:08:58 Andys-iPhone com.apple.debugserver-199[188] <Warning>: debugserver-199 for armv7.
Sep 18 13:08:58 Andys-iPhone com.apple.debugserver-199[188] <Warning>: Connecting to com.apple.debugserver service...
Sep 18 13:08:58 Andys-iPhone com.apple.debugserver-199[188] <Warning>: Got a connection, waiting for process information for launching or attaching.
Sep 18 13:08:58 Andys-iPhone kernel[0] <Debug>: lockbot[176] Builtin profile: debugserver (sandbox)
Sep 18 13:08:58 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.margiesparrow.wribble[0xab5][189]) <Warning>: (UIKitApplication:com.margiesparrow.wribble[0xab5]) Spawned and waiting for the debugger to attach before continuing...
Sep 18 13:08:58 Andys-iPhone amfid[190] <Error>: Sep 18 13:08:58  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Sep 18 13:08:59 Andys-iPhone kernel[0] <Debug>: launchd[189] Builtin profile: container (sandbox)
Sep 18 13:08:59 Andys-iPhone kernel[0] <Debug>: launchd[189] Container: /private/var/mobile/Applications/91C0CC2E-FD86-4606-9050-E9F17BFF0DA9 (sandbox)
Sep 18 13:08:59 Andys-iPhone com.apple.debugserver-199[188] <Warning>: Got a connection, waiting for debugger instructions.
Sep 18 13:09:02 Andys-iPhone kernel[0] <Debug>: AppleSerialMultiplexer: mux-ad(eng)::setLinkQualityMetricGated: Setting link quality metric to 50
Sep 18 13:09:10 Andys-iPhone levelword[189] <Warning>: Number of words loaded from words.txt:178694
Sep 18 13:09:20 Andys-iPhone mediaserverd[38] <Notice>: 2013-09-18 01:09:20.307416 PM [AirPlayScreenClient] ### Screen not supported on this device (iPhone2,1)
Sep 18 13:09:22 Andys-iPhone levelword[189] <Warning>: drawBackground
Sep 18 13:09:22 Andys-iPhone levelword[189] <Warning>: showLevelPopUp
Sep 18 13:09:31 Andys-iPhone profiled[78] <Notice>: (Note ) profiled: Idled.
Sep 18 13:09:31 Andys-iPhone profiled[78] <Notice>: (Note ) profiled: Service stopping.
Sep 18 13:09:33 Andys-iPhone kernel[0] <Debug>: AppleSerialMultiplexer: mux-ad(eng)::setLinkQualityMetricGated: Setting link quality metric to 100
Sep 18 13:09:55 Andys-iPhone levelword[189] <Warning>: tgvc applicationdidenterbackground
Sep 18 13:09:58 Andys-iPhone levelword[189] <Warning>: drawBackground
Sep 18 13:09:58 Andys-iPhone levelword[189] <Warning>: showLevelPopUp
Sep 18 13:10:01 Andys-iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.BlueTool[69]) <Notice>: (com.apple.BlueTool) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.BlueTool[69]) <Notice>: (com.apple.BlueTool) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.deleted[56]) <Notice>: (com.apple.mobile.deleted) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.deleted[56]) <Notice>: (com.apple.mobile.deleted) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.xpcd.F5010000-0000-0000-0000-000000000000[92]) <Notice>: (com.apple.xpcd.F5010000-0000-0000-0000-000000000000) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.crashreportcopymobile[120]) <Notice>: (com.apple.crashreportcopymobile) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.crashreportcopymobile[120]) <Notice>: (com.apple.crashreportcopymobile) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.assetsd[101]) <Notice>: (com.apple.assetsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.assetsd[101]) <Notice>: (com.apple.assetsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.timed[16]) <Notice>: (com.apple.timed) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.timed[16]) <Notice>: (com.apple.timed) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.coreservices.appleid.authentication[58]) <Notice>: (com.apple.coreservices.appleid.authentication) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.coreservices.appleid.authentication[58]) <Notice>: (com.apple.coreservices.appleid.authentication) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.itunesstored[74]) <Notice>: (com.apple.itunesstored) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.itunesstored[74]) <Notice>: (com.apple.itunesstored) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.assertion_agent[110]) <Notice>: (com.apple.mobile.assertion_agent) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.assertion_agent[110]) <Notice>: (com.apple.mobile.assertion_agent) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.accountsd[84]) <Notice>: (com.apple.accountsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.accountsd[84]) <Notice>: (com.apple.accountsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.recentsd[186]) <Notice>: (com.apple.recentsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.recentsd[186]) <Notice>: (com.apple.recentsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.lsd[86]) <Notice>: (com.apple.lsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.lsd[86]) <Notice>: (com.apple.lsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.installd[53]) <Notice>: (com.apple.mobile.installd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.installd[53]) <Notice>: (com.apple.mobile.installd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.networkd_privileged[70]) <Notice>: (com.apple.networkd_privileged) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.networkd_privileged[70]) <Notice>: (com.apple.networkd_privileged) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.softwareupdateservicesd[97]) <Notice>: (com.apple.softwareupdateservicesd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.softwareupdateservicesd[97]) <Notice>: (com.apple.softwareupdateservicesd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.gamed[79]) <Notice>: (com.apple.gamed) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.gamed[79]) <Notice>: (com.apple.gamed) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone SpringBoard[76] <Warning>: Received memory warning.
Sep 18 13:10:01 Andys-iPhone levelword[189] <Warning>: Received memory warning.
Sep 18 13:10:02 Andys-iPhone levelword[189] <Warning>: Received memory warning.
Sep 18 13:10:02 Andys-iPhone ReportCrash[195] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Sep 18 13:10:02 Andys-iPhone ReportCrash[195] <Notice>: Not saving suspended-only Jetsam log because already dumped today.
Sep 18 13:10:02 Andys-iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Sep 18 13:10:02 Andys-iPhone levelword[189] <Warning>: Received memory warning.
Sep 18 13:10:10 Andys-iPhone levelword[189] <Warning>: tgvc applicationdidenterbackground
Sep 18 13:10:10 Andys-iPhone levelword[189] <Warning>: tgvc applicationdidenterbackground
Sep 18 13:10:12 Andys-iPhone ReportCrash[196] <Notice>: Not saving Jetsam log because no data from the kernel.
Sep 18 13:10:14 Andys-iPhone levelword[189] <Warning>: drawBackground
Sep 18 13:10:14 Andys-iPhone levelword[189] <Warning>: showLevelPopUp
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.apple.mobilephone[0x955][96]) <Notice>: (UIKitApplication:com.apple.mobilephone[0x955]) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (com.apple.TextInput.kbd[50]) <Notice>: (com.apple.TextInput.kbd) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (com.apple.tccd[93]) <Notice>: (com.apple.tccd) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.margiesparrow.wribble[0xab5][189]) <Notice>: (UIKitApplication:com.margiesparrow.wribble[0xab5]) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.apple.mobilemail[0x60e][99]) <Notice>: (UIKitApplication:com.apple.mobilemail[0x60e]) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Sep 18 13:10:17 Andys-iPhone com.apple.debugserver-199[188] <Warning>: 1 +0.000000 sec [00bc/1303]: error: ::read ( 5, 0x2fe809fc, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Sep 18 13:10:18 Andys-iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.apple.mobilephone[0x955]' exited abnormally with signal 9: Killed: 9
Sep 18 13:10:18 Andys-iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.margiesparrow.wribble[0xab5]' exited abnormally with signal 9: Killed: 9
Sep 18 13:10:18 Andys-iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.apple.mobilemail[0x60e]' exited abnormally with signal 9: Killed: 9
Sep 18 13:10:22 Andys-iPhone ReportCrash[203] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system 

version dictionary

我期待着您能提供的任何帮助。

亲切的问候安迪

4

1 回答 1

1

“我运行了分析,只检测到了死存储。” 修复它们。修复所有警告。Run Instruments,配置工具。您不应该看到内存继续增加。如果是使用Heapshot分析:

使用仪器检查由于保留但未泄漏的内存而导致的泄漏和内存丢失。后者是仍然指向的未使用内存。在 Instruments 上的 Allocations 工具中使用 Heapshot。

有关如何使用 Heapshot 查找内存占用,请参阅:bbum 博客

基本上有方法是运行 Instruments allocate 工具,拍摄一个 heapshot,运行你的代码的直觉和另一个 heapshot 重复 3 或 4 次。这将指示在迭代期间已分配但未释放的内存。

要弄清楚结果,请查看个人分配。

如果您需要查看对象使用工具的保留、释放和自动释放发生的位置:

在仪器中运行,在分配中设置“记录参考计数”(您必须停止记录才能设置选项)。使选择器运行,停止记录,在那里搜索 ivar (datePickerView),向下钻取,您将能够看到所有保留、释放和自动释放发生的位置。

还要考虑 Xcode 5,运行应用程序,选择 Debug Navigator,选择 Memory 并观察内存发生了什么。

于 2013-09-18T02:31:52.170 回答