提问



我在导航堆栈上推送一个viewController,当我到达下一个视图然后返回然后重新启动视图时它会在崩溃中结束...
这是代码..


SampleViewController *obj=[**SampleViewController alloc]initWithNibName:nil bundle:nil];
    obj.delegate=self; 
    self.title=@"TESTT";
    [self.navigationController pushViewController:obj animated:YES];
    [obj release];


但如果我把obj视为全局,那么崩溃就不会发生......我知道它的一些非常常见,但我无法弄明白。


崩溃日志..


Process:         INGDirectOCRSampleApp [4940]
Path:            /Users/chetna368474/Library/Application Support/iPhone Simulator/5.0/Applications/88310229-D5BA-4B1B-BBE2-F49E1C35CD25/INGDirectOCRSampleApp.app/INGDirectOCRSampleApp
Identifier:      INGDirectOCRSampleApp
Version:         ??? (???)
Code Type:       X86 (Native)
Parent Process:  launchd [1193]

Date/Time:       2012-04-06 17:48:00.057 +0530
OS Version:      Mac OS X 10.6.8 (10K549)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  0

Application Specific Information:
objc_msgSend() selector name: release
iPhone Simulator 272, iPhone OS 5.0 (iPhone/9A334)


Thread 0 Crashed:
0   libobjc.A.dylib                 0x0192209f objc_msgSend + 19
1   CoreFoundation                  0x01b30435 CFRelease + 117
2   CoreFoundation                  0x01c11e94 -[__NSArrayM dealloc] + 180
3   libobjc.A.dylib                 0x01922e4d _objc_rootRelease + 47
4   UIKit                           0x008760f9 -[UIView(Internal) _invalidateSubviewCache] + 44
5   UIKit                           0x0087142f __UIViewWillBeRemovedFromSuperview + 689
6   UIKit                           0x008710d7 -[UIView(Hierarchy) removeFromSuperview] + 70
7   UIKit                           0x0086d1e0 -[UIView dealloc] + 309
8   libobjc.A.dylib                 0x01922e4d _objc_rootRelease + 47
9   libobjc.A.dylib                 0x01922e10 objc_release + 48
10  libobjc.A.dylib                 0x01923c60 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 528
11  CoreFoundation                  0x01b58ed8 _CFAutoreleasePoolPop + 24
12  CoreFoundation                  0x01b5b83b __CFRunLoopRun + 2011
13  CoreFoundation                  0x01b5adb4 CFRunLoopRunSpecific + 212
14  CoreFoundation                  0x01b5accb CFRunLoopRunInMode + 123
15  GraphicsServices                0x0225e879 GSEventRunModal + 207
16  GraphicsServices                0x0225e93e GSEventRun + 114
17  UIKit                           0x0083aa9b UIApplicationMain + 1175
18  INGDirectOCRSampleApp           0x0000271d main + 125 (main.m:14)
19  INGDirectOCRSampleApp           0x00002695 start + 53

Thread 1:
0   libSystem.B.dylib               0x994de382 kevent + 10
1   libdispatch.dylib               0x0222f373 _dispatch_mgr_invoke + 918
2   libdispatch.dylib               0x0222dcd0 _dispatch_mgr_wakeup + 0

Thread 2:
0   libSystem.B.dylib               0x994dd412 __workq_kernreturn + 10
1   libSystem.B.dylib               0x994dd9a8 _pthread_wqthread + 941
2   libSystem.B.dylib               0x994dd5c6 start_wqthread + 30

Thread 3:
0   libSystem.B.dylib               0x994dd5a8 start_wqthread + 0

Thread 4:  WebThread
0   libSystem.B.dylib               0x994b7afa mach_msg_trap + 10
1   libSystem.B.dylib               0x994b8267 mach_msg + 68
2   CoreFoundation                  0x01bf813a __CFRunLoopServiceMachPort + 186
3   CoreFoundation                  0x01b5b605 __CFRunLoopRun + 1445
4   CoreFoundation                  0x01b5adb4 CFRunLoopRunSpecific + 212
5   CoreFoundation                  0x01b5accb CFRunLoopRunInMode + 123
6   WebCore                         0x03940220 RunWebThread(void*) + 560
7   libSystem.B.dylib               0x994e5259 _pthread_start + 345
8   libSystem.B.dylib               0x994e50de thread_start + 34

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x08013060  ebx: 0x00000007  ecx: 0x01928405  edx: 0x0800e513
  edi: 0x00000000  esi: 0x00000008  ebp: 0xbfffde98  esp: 0xbfffde44
   ss: 0x0000001f  efl: 0x00010206  eip: 0x0192209f   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x00000000

Binary Images:
    0x1000 -   0x344fe3 +INGDirectOCRSampleApp ??? (???) <23D12858-D540-3EBA-842A-C6AC77BC14F3> /Users/chetna368474/Library/Application Support/iPhone Simulator/5.0/Applications/88310229-D5BA-4B1B-BBE2-F49E1C35CD25/INGDirectOCRSampleApp.app/INGDirectOCRSampleApp
  0x4db000 -   0x70cff7 +Foundation 881.0.0 (compatibility 300.0.0) <027E5CAE-30D1-3F0C-851D-28B153D01989> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Foundation.framework/Foundation
  0x830000 -   0xe4fff7 +UIKit 1600.0.0 (compatibility 1.0.0) <26D83691-BE8F-33A2-968F-85A36B4E076D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit
 0x112a000 -  0x1317ffb  com.apple.CoreGraphics 1.600.0 (???) <10DC20E5-ADED-34E8-B66A-7971EF4B7F1E> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
 0x1370000 -  0x1384ff7 +OpenGLES ??? (???) <693FCBF7-B9ED-3E74-8B13-D91AEC1B9421> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/OpenGLES.framework/OpenGLES
 0x138e000 -  0x14c4ffb +QuartzCore 1.7.0 (compatibility 1.2.0) <AE0F3BAD-B9D9-3F9A-93EC-094715C34B23> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/QuartzCore.framework/QuartzCore
 0x1538000 -  0x159aff3 +libstdc++.6.dylib 53.4.0 (compatibility 7.0.0) <75457A46-A389-39C4-BF1F-D3E61BD20B9D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libstdc++.6.dylib
 0x15f3000 -  0x160ffff +libSystem.dylib 125.0.0 (compatibility 1.0.0) <5127F6A5-1667-3F50-8F15-19A6F7628849> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libSystem.dylib
 0x1624000 -  0x1690ff3 +MobileCoreServices 34.0.0 (compatibility 1.0.0) <A1C65859-E8C7-3AF3-BD2C-6AF20276A1C5> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
 0x16bf000 -  0x1880fff +libicucore.A.dylib 48.0.0 (compatibility 1.0.0) <44D4F919-7BE7-34B1-8687-060DD594E44F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libicucore.A.dylib
 0x190a000 -  0x19df787 +libobjc.A.dylib 227.0.0 (compatibility 1.0.0) <879E1E4D-1823-3A4A-9F16-E45A4094B69F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libobjc.A.dylib
 0x19f1000 -  0x1aeefff +libxml2.2.dylib 10.3.0 (compatibility 10.0.0) <52BE5F04-7BA6-322A-82B9-2F86235B47C0> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libxml2.2.dylib
 0x1b12000 -  0x1b21ff7 +libz.1.dylib 1.2.5 (compatibility 1.0.0) <FB257E91-EEC6-33C5-917B-8E20E6154002> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libz.1.dylib
 0x1b26000 -  0x1ca6ff7 +CoreFoundation 675.0.0 (compatibility 150.0.0) <387FB5D2-1E55-3A8F-863D-89F0ED41DDB7> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 0x1db0000 -  0x1f1fff7 +CFNetwork 548.0.3 (compatibility 1.0.0) <3EA631BA-29CA-3BC9-A8ED-81F3844BCF33> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CFNetwork.framework/CFNetwork
 0x1fb6000 -  0x2002ff7 +SystemConfiguration 432.0.0 (compatibility 1.0.0) <DFFE2D1B-2CF3-33BE-99C2-20414AAC3BAF> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
 0x2023000 -  0x207eff7 +Security ??? (???) <A58C38F3-DF57-33FD-8767-BFFF46602036> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Security.framework/Security
 0x20a3000 -  0x20a8fff +IOKit 275.0.0 (compatibility 1.0.0) <D8D53356-F68E-3D16-834D-0451BEFB197C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/IOKit.framework/IOKit
 0x20b0000 -  0x20c2ff7 +libCRFSuite.dylib ??? (???) <87C6506C-A64D-37CB-A6B4-D5B16147E00D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libCRFSuite.dylib
 0x20c9000 -  0x20cafff +liblangid.dylib ??? (???) <CEDA1D3E-21DB-3766-A2C0-358E1B9FED37> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/liblangid.dylib
 0x20ce000 -  0x20e3ff3 +GenerationalStorage 124.0.0 (compatibility 1.0.0) <AB141CE7-1889-3225-83DE-809C71AC6AB4> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/GenerationalStorage.framework/GenerationalStorage
 0x20eb000 -  0x20fefff +libbsm.0.dylib ??? (???) <1DDEB086-AFC7-3486-83BB-AA194E5FD33F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libbsm.0.dylib
 0x2106000 -  0x211effb +SpringBoardServices ??? (???) <9D85DA2B-B27F-3F94-A1E1-8B4C3A57DE3E> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
 0x212e000 -  0x2137ff7 +libc++abi.dylib 15.1.0 (compatibility 1.0.0) <A2EB5EEE-E35D-3749-B631-527C48ECCB4B> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libc++abi.dylib
 0x213f000 -  0x2143fff +libSystem.override.dylib ??? (???) <893ED023-4976-3C97-97A5-DA0EAB349B7C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libSystem.override.dylib
 0x2149000 -  0x214eff3 +libcache_sim.dylib 49.0.0 (compatibility 1.0.0) <53EB5246-7978-3FB7-A272-33AC81F6B98F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libcache_sim.dylib
 0x2153000 -  0x21adffb +libcommonCrypto_sim.dylib 40146.0.0 (compatibility 1.0.0) <519CF629-B054-3DA7-90F4-08773FB53CDB> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libcommonCrypto_sim.dylib
 0x21bc000 -  0x21c4ff7 +libnotify_sim.dylib 87.3.0 (compatibility 1.0.0) <DCAAE9AA-5A73-3175-A97D-A69AFF09321B> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libnotify_sim.dylib
 0x21cb000 -  0x21ccff3 +libsystem_sim_blocks.dylib 54.0.0 (compatibility 1.0.0) <37A1DF5C-5076-3367-BD66-665610FD4487> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libsystem_sim_blocks.dylib
 0x21d1000 -  0x21d8fff +libsystem_sim_dnssd.dylib ??? (???) <5C3A3B8C-FFEA-30ED-BBD1-71D5D97FD8A1> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libsystem_sim_dnssd.dylib
 0x21de000 -  0x21f6ffb +libsystem_sim_info.dylib ??? (???) <85EDCF1A-20F6-3E73-B118-97294E96C977> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libsystem_sim_info.dylib
 0x2202000 -  0x221bfff +libxpc_sim.dylib 89.9.0 (compatibility 1.0.0) <A418D307-3C2F-38DD-945D-DAE45A6582D7> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libxpc_sim.dylib
 0x222c000 -  0x223afff +libdispatch.dylib 192.7.0 (compatibility 1.0.0) <54FEE9FB-F069-3FA2-BE6F-33B7FC2EFD79> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/system/libdispatch.dylib
 0x2248000 -  0x2251ff3 +MobileIcons ??? (???) <EF0292AB-A467-3882-8C92-28347A3819EE> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/MobileIcons.framework/MobileIcons
 0x2258000 -  0x2267ff7 +GraphicsServices 14.0.0 (compatibility 1.0.0) <E153F0E5-7F75-3AFD-B503-5FDF565D3FC3> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
 0x2277000 -  0x22c5ffb +AppSupport 29.0.0 (compatibility 1.0.0) <8EB0F934-4EF5-37FD-B3BE-443789B3C52B> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
 0x22f2000 -  0x2555fff +ImageIO ??? (???) <A63F2787-CCAB-3A9A-A5A6-A13781509389> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/ImageIO.framework/ImageIO
 0x25c9000 -  0x2650ff7 +CoreTelephony 1259.20.0 (compatibility 1.0.0) <B050E3A1-AD1A-3716-8EF7-15CAF6A4B485> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
 0x269d000 -  0x274dfe3 +libsqlite3.dylib 9.6.0 (compatibility 9.0.0) <8E9286EE-489F-3B46-9EC7-5EEB577D266F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libsqlite3.dylib
 0x275e000 -  0x275fffb +DataMigration ??? (???) <1F000AFF-65EA-353E-B4C6-6609068AFA5D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/DataMigration.framework/DataMigration
 0x2764000 -  0x2767fff +MobileInstallation ??? (???) <E3BEA46C-4DEF-36FB-BA66-141F12BDCCA1> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
 0x276d000 -  0x27a6ff3 +Bom 177.0.0 (compatibility 2.0.0) <890AB4DC-3952-32BA-A95B-9B7796EBCADF> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/Bom.framework/Bom
 0x27b6000 -  0x27c1ff7 +libbz2.1.0.dylib 1.0.5 (compatibility 1.0.0) <8B645C67-20CB-3D37-BBFA-BB128CA88156> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libbz2.1.0.dylib
 0x27c6000 -  0x2857ff3 +CoreImage ??? (???) <1A7D7B6B-F807-3AEB-8E34-A2F1D2B1B357> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreImage.framework/CoreImage
 0x2894000 -  0x28b6fff +DictionaryServices ??? (???) <F9A6B266-6EF6-3FEF-B3A5-1BC1F8E3DE6B> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/DictionaryServices.framework/DictionaryServices
 0x28cb000 -  0x292cff7 +AddressBook 30.0.0 (compatibility 1.0.0) <247EDA1C-4F66-36E8-BFC4-A0DEBEAB982C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/AddressBook.framework/AddressBook
 0x2962000 -  0x2bb9fff +AudioToolbox 359.0.0 (compatibility 1.0.0) <717E08AE-DD99-3A06-9C44-FF772EEA7195> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
 0x2c58000 -  0x2cf3ffb +CoreText ??? (???) <52F69A81-86F9-38A1-A100-23B6A8A4D861> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreText.framework/CoreText
 0x2d32000 -  0x2e38ffb +WebKit 534.46.0 (compatibility 1.0.0) <F383D416-4DE0-34E6-A94C-C63A3B0025FD> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/WebKit.framework/WebKit
 0x2ed5000 -  0x3e3ffe3 +WebCore 534.46.0 (compatibility 1.0.0) <EEB65FF8-9D43-3B37-96AE-3102A6BE76A5> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/WebCore.framework/WebCore
 0x44b2000 -  0x4560ffb +ProofReader 139.0.0 (compatibility 1.0.0) <9CBFF464-6B89-393C-8E43-ADC49A740546> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
 0x4578000 -  0x457effb +libAccessibility.dylib ??? (???) <78A2E26B-69F6-321D-8B5E-D07B7CBA6182> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libAccessibility.dylib
 0x4588000 -  0x4588fff +Accelerate 4.0.0 (compatibility 1.0.0) <DAE15C64-60F8-3B10-B87C-D704E169FD62> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Accelerate
 0x458b000 -  0x45bcff3 +PrintKit 88.0.0 (compatibility 1.0.0) <B7FB7AC7-2E8D-360D-A03D-534413912239> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/PrintKit.framework/PrintKit
 0x45d2000 -  0x45ddffb +libMobileGestalt.dylib ??? (???) <66B261AB-1F53-3BF4-9328-D0C747017B7A> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libMobileGestalt.dylib
 0x45e7000 -  0x4a4fffb +FaceCoreLight 1.4.7 (compatibility 1.0.0) <DDB8F982-43AD-3367-B34E-C9917315D6F3> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/FaceCoreLight.framework/FaceCoreLight
 0x4dec000 -  0x4dfcff3 +CoreVideo 1.7.0 (compatibility 1.2.0) <5681793A-03E0-3BD2-8817-32D1568FBDE5> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreVideo.framework/CoreVideo
 0x4e0b000 -  0x4e10ffb +libGFXShared.dylib ??? (???) <78F8E32B-0447-363B-A936-1568E60DB103> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
 0x4e16000 -  0x4e58ff7 +libGLImage.dylib ??? (???) <C21A5358-73F3-3D1B-9366-68FCF58B3FC6> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
 0x4e60000 -  0x4e62ffb +libCVMSPluginSupport.dylib ??? (???) <EF8712F2-EE22-31B7-AEA6-B52E5418367C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/OpenGLES.framework/libCVMSPluginSupport.dylib
 0x4e67000 -  0x4e6effb +libCoreVMClient.dylib ??? (???) <10A05BFE-EF18-3C91-B377-94BECFA42F10> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/OpenGLES.framework/libCoreVMClient.dylib
 0x4e76000 -  0x5608fcf +libLLVMContainer.dylib ??? (???) <B3CBADCC-5A6A-325C-9C42-28E7FF9CE76F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/OpenGLES.framework/libLLVMContainer.dylib
 0x5959000 -  0x5a80ffb +vImage 185.0.0 (compatibility 1.0.0) <AECF34F9-6885-3E80-9255-5F65F46D1226> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/vImage
 0x5a9b000 -  0x5a9bfff +vecLib 348.5.0 (compatibility 1.0.0) <9314A02C-F7F6-3F2E-AF86-71A581D86794> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
 0x5a9e000 -  0x5b03fe3 +libvDSP.dylib 348.5.0 (compatibility 1.0.0) <2971D7CF-6B2F-32F3-A335-E67F3308EA62> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
 0x5b0d000 -  0x5f27ff7 +libLAPACK.dylib ??? (???) <170AD7C4-3E12-3866-8B09-CF3D7A3901FF> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
 0x5f54000 -  0x643dffb +libBLAS.dylib ??? (???) <637EF410-C629-38BF-A00C-89DA9CB8EE64> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
 0x646b000 -  0x64dfffb +libvMisc.dylib 348.5.0 (compatibility 1.0.0) <D3E59670-5FC5-381E-B994-21261AFE195D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvMisc.dylib
 0x64e6000 -  0x6511ff7 +libxslt.1.dylib 3.24.0 (compatibility 3.0.0) <A50B2DC2-A345-3A90-A2D3-F83A3F01B515> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libxslt.1.dylib
 0x651c000 -  0x6523ffb +AggregateDictionary ??? (???) <601ED459-B0C5-3CB6-A2CF-8EF09D68AFFE> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary
 0x652a000 -  0x6541ffb +DataAccessExpress ??? (???) <9196A8BB-AA0A-3063-8A02-BCAAFF6C793B> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/DataAccessExpress.framework/DataAccessExpress
 0x6554000 -  0x6563fff +AccountSettings ??? (???) <AEBCC1A4-213F-3338-AFCB-CA8728FB1134> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/AccountSettings.framework/AccountSettings
 0x656d000 -  0x65c8fff +ManagedConfiguration ??? (???) <CAD36AF4-D4EB-3C35-86A3-0F78B971EB9F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/ManagedConfiguration.framework/ManagedConfiguration
 0x6607000 -  0x661bff7 +PersistentConnection ??? (???) <C1674D83-862C-3EEA-8172-0E52ADC900B7> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/PersistentConnection.framework/PersistentConnection
 0x662c000 -  0x66a9fff +CoreAudio ??? (???) <9789D4A8-A5EC-318A-AEC0-11A05FCA412C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreAudio.framework/CoreAudio
 0x66e0000 -  0x6742fff +libc++.1.dylib 25.1.0 (compatibility 1.0.0) <D0D81167-0B12-3E7A-9B79-52BBB4498158> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libc++.1.dylib
 0x6798000 -  0x6939ffb +JavaScriptCore 534.46.0 (compatibility 1.0.0) <A6AECBE2-0156-3279-BD6F-A6A951AB904C> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
 0x69a7000 -  0x69b1fff +AssetsLibraryServices ??? (???) <9717070C-6F0F-3317-8DC8-2E5689E13343> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices
 0x69bc000 -  0x6aacff7 +libiconv.2.dylib 7.0.0 (compatibility 7.0.0) <81D3CF72-871D-3CD7-8A93-A840FA11B5E5> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libiconv.2.dylib
 0x6ab9000 -  0x6ab9ffb +libresolv.dylib 41.0.0 (compatibility 1.0.0) <9CDCBA6B-B685-3E68-8042-DC399A861C08> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/usr/lib/libresolv.dylib
 0x6abe000 -  0x6b18ff7 +CoreLocation 1223.3.0 (compatibility 1.0.0) <FA7E83B9-390A-3AB8-A328-C560A4DCAF7D> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreLocation.framework/CoreLocation
 0x6b44000 -  0x6ba5ff7 +GeoServices 84.0.0 (compatibility 1.0.0) <BC020B7B-0F36-34EE-A09E-FF695F36FC8B> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
 0x6bc8000 -  0x6bccffb +CoreTime ??? (???) <15658E42-14C3-3411-AA11-48930BF4629F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/CoreTime.framework/CoreTime
 0x6bd3000 -  0x6bddfff +ProtocolBuffer 57.0.0 (compatibility 1.0.0) <9DC44A7F-8696-393B-AA50-69E6BC8B177F> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/PrivateFrameworks/ProtocolBuffer.framework/ProtocolBuffer
 0x6cae000 -  0x6cd5ff7 +libRIP.A.dylib 600.0.0 (compatibility 64.0.0) <ECC74B2F-3924-3D1C-8715-C5A67E48A490> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
 0xaf00000 -  0xaf4cffb +libCGFreetype.A.dylib 600.0.0 (compatibility 64.0.0) <5A17326C-7E22-36FB-9200-DF0B9106C194> /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x8fe00000 - 0x8fe4162b  dyld 132.1 (???) <1C06ECD9-A2D7-BB10-AF50-0F2B598A7DEC> /usr/lib/dyld
0x90f05000 - 0x90f62ff7  com.apple.framework.IOKit 2.0 (???) <3DABAB9C-4949-F441-B077-0498F8E47A35> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x95b0d000 - 0x95b10fe7  libmathCommon.A.dylib 315.0.0 (compatibility 1.0.0) <1622A54F-1A98-2CBE-B6A4-2122981A500E> /usr/lib/system/libmathCommon.A.dylib
0x994b7000 - 0x9965eff7  libSystem.B.dylib 125.2.11 (compatibility 1.0.0) <2DCD13E3-1BD1-6F25-119A-3863A3848B90> /usr/lib/libSystem.B.dylib
0x9aae7000 - 0x9ab07fe7  libresolv.9.dylib 41.0.0 (compatibility 1.0.0) <BF7FF2F6-5FD3-D78F-77BC-9E2CB2A5E309> /usr/lib/libresolv.9.dylib
0x9abc8000 - 0x9abd4ff7  libkxld.dylib ??? (???) <9A441C48-2D18-E716-5F38-CBEAE6A0BB3E> /usr/lib/system/libkxld.dylib
0xffff0000 - 0xffff1fff  libSystem.B.dylib ??? (???) <2DCD13E3-1BD1-6F25-119A-3863A3848B90> /usr/lib/libSystem.B.dylib

最佳参考


如果你不能使用NSZombies,我们需要一点点猜测才能找到问题......


让我们首先将堆栈轨迹颠倒过来。


UIView被解除分配(最有可能self.view)


7   UIKit                           0x0086d1e0 -[UIView dealloc] + 309
6   UIKit                           0x008710d7 -[UIView(Hierarchy) removeFromSuperview] + 70
5   UIKit                           0x0087142f __UIViewWillBeRemovedFromSuperview + 689
4   UIKit                           0x008760f9 -[UIView(Internal) _invalidateSubviewCache] + 44


这个UIView发布了它的subviewCache(一个NSArray),它被解除分配并向它包含的对象发送一条释放消息。


3   libobjc.A.dylib                 0x01922e4d _objc_rootRelease + 47
2   CoreFoundation                  0x01c11e94 -[__NSArrayM dealloc] + 180
1   CoreFoundation                  0x01b30435 CFRelease + 117
0   libobjc.A.dylib                 0x0192209f objc_msgSend + 19


然后应用程序崩溃,因为它很可能尝试释放已经解除分配的对象。


看起来您的某个子视图已过度发布。


在代码中搜索没有alloc但由您发布的对象。分析仪会帮助你。


检查错误的代码,如下所示:


UIButton *aButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // <- autoreleased
[self.view addSubview:aButton];
[aButton release];                                                     // <- released again. Wrong!


如果方法不包含allocnewcopyretain,则必须不release它返回的对象,因为该方法返回一个自动释放的对象。

其它参考1


你可以像这段代码一样做


if(obj == nil)
    obj=[**SampleViewController alloc]initWithNibName:nil bundle:nil];
obj.delegate=self; 
self.title=@"TESTT";
[self.navigationController pushViewController:obj animated:YES];


并创建Object Global,在这里你不需要释放对象,下次当你遇到这些解决内存泄漏问题的行时就可以创建它。

其它参考2


我确信在发布崩溃时你必须在dealloc函数(在所有viewcontrollers中)注释掉所有版本的某些东西发布了一个问题,然后运行App并检查你的应用程序中是否会发现崩溃。


一旦你达到这一点,逐一取消注释dealloc功能。你发现了崩溃......

其它参考3


SampleViewController *obj=[**SampleViewController alloc]init];
    obj.delegate=self; 
    self.title=@"TESTT";
    [self.navigationController pushViewController:obj animated:YES];
    [obj release];