2010-01-27 5 views
0

저는 초보자이며 시뮬레이터에서 실행되는 iPhone 응용 프로그램에 대한 도움이 필요합니다. 응용 프로그램은 잘 작동합니다. 빌드 & 실행 또는 빌드 & 실행 중단 점은 꺼져 있지만 빌드 & 디버그 - 중단 점 켜짐으로 실행하면 불면합니다. 어떤 도움이나 생각이라도 대단히 감사하겠습니다. LoniPhone 메모리 오류 - 빌드 및 디버그를 사용할 때 디버그하는 방법?

세부 사항 : 중단 점 설정 안 함, 보이는 시뮬레이터 결과에 도달하지 않음, 출력을 생성하기 전에 초기화 단계에서 불어 오는 것처럼 보임. 앱 출처는 Danoney & Tracey Pilone의 "Head First iPhone 개발"책 (280 페이지에 작성된 예제)의 DrinkMixer 예제입니다. 이 에러 메시지

불면 다음과 같이

Attaching to process 970. 
Pending breakpoint 1 - "*0x01c1b001" resolved 
Program received signal: “EXC_BAD_ACCESS”. 
No memory available to program now: unsafe to call malloc 
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Not safe to call dlopen at this time.) 
No memory available to program now: unsafe to call malloc 
--- 
Leaks: 
The only object noted as "leaked Object" is: 
Leaked Object # Address Size Responsible Library Responsible Frame 
Malloc 128 Bytes <blank> 0x3c11950 128Bytes CoreGraphics open_handle_to_dylib_path 
___ 

Object Allocations shows (Highest at top = CFString): 

Category --- Overall Bytes -- #Overall -- Live Bytes -- #Living 
* All Allocations * 497kb  #5888 496kb #5878 10 
CFString    42kb  #1126 42kb  
Malloc 32.00 KB 32kb  #1  32kb 
Malloc 1.00 KB 29kb  #29  29kb 
Malloc 8.00 KB 24kb  #3  24kb  
Malloc 32 Bytes 20.81kb #666 20.75kb 
Malloc 1.50 KB 19.5kb #13  19.5kb 
CFDictionary (key-store) 17.64kb #159 17.64kb 

(note: Except for "All Allocations, the #Living is the same as #Overall) 
--- 

List of Calls from Debugger: 

#0 0x01c1b010 in CFStringCreateByCombiningStrings 
#1 0x023a0779 in LoadFontPathCache 
#2 0x023a096b in Initialize 
#3 0x023a0f3e in GSFontCreateWithName 
#4 0x003d4575 in +[UIFont boldSystemFontOfSize:] 
#5 0x002cddaa in +[UINavigationButton defaultFont] 
#6 0x002d9e37 in -[UINavigationButton initWithValue:width:style:barStyle:possibleTitles:tintColor:] 
#7 0x002cdc75 in -[UINavigationButton initWithImage:width:style:] 
#8 0x00468eeb in -[UIBarButtonItem(Static) createViewForNavigationItem:] 
#9 0x002d1b56 in -[UINavigationItem customRightView] 
#10 0x002d20e3 in -[UINavigationItem updateNavigationBarButtonsAnimated:] 
#11 0x002d1e1a in -[UINavigationItem setRightBarButtonItem:] 
#12 0x00002e7b in -[RootViewController viewDidLoad] at RootViewController.m:41 
#13 0x00313796 in -[UIViewController view] 
#14 0x00311d92 in -[UIViewController contentScrollView] 
#15 0x0031c2b4 in -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] 
#16 0x0031b32e in -[UINavigationController _layoutViewController:] 
#17 0x0031cd1a in -[UINavigationController _startTransition:fromViewController:toViewController:] 
#18 0x0031831a in -[UINavigationController _startDeferredTransitionIfNeeded] 
#19 0x004362e4 in -[UILayoutContainerView layoutSubviews] 
#20 0x035342b0 in -[CALayer layoutSublayers] 
#21 0x0353406f in CALayerLayoutIfNeeded 
#22 0x035338c6 in CA::Context::commit_transaction 
#23 0x0353353a in CA::Transaction::commit 
#24 0x00295ef9 in -[UIApplication _reportAppLaunchFinished] 
#25 0x0029bb88 in -[UIApplication handleEvent:withNewEvent:] 
#26 0x002976d3 in -[UIApplication sendEvent:] 
#27 0x0029e0b5 in _UIApplicationHandleEvent 
#28 0x023a3ed1 in PurpleEventCallback 
#29 0x01bb6b80 in CFRunLoopRunSpecific 
#30 0x01bb5c48 in CFRunLoopRunInMode 
#31 0x00295e69 in -[UIApplication _run] 
#32 0x0029f003 in UIApplicationMain 
#33 0x00002ba0 in main at main.m:14 

(아래에서 언급) 라인 # 41를 포함하는 코드이다. 그리고 형식의 도움과 의견에 대한 감사 :

#import "RootViewController.h" 
#import "DrinkDetailViewController.h"; 
#import "DrinkConstants.h" 
#import "AddDrinkViewController.h" 
@implementation RootViewController 
@synthesize drinks, addButtonItem; 
- (void)viewDidLoad { 
    [super viewDidLoad];  
    // add PATH for PLIST 
    NSString *path = [[NSBundle mainBundle] pathForResource: 
         @"DrinkDirections" ofType:@"plist"]; 
    NSMutableArray *tmpArray = [[NSMutableArray alloc]        initWithContentsOfFile:path]; 
    self.drinks = tmpArray; 
    [tmpArray release]; 

// Next is Line #41 - I removed earlier empty lines & Comments 

    self.navigationItem.rightBarButtonItem = self.addButtonItem; 

} 
- (IBAction) addButtonPressed: (id) sender { 
    NSLog(@"Add button pressed!"); 

+0

그래서 당신은 RootViewController.m 라인 (41)의 주위합니까 무엇? 몇 가지 코드를 보여주십시오. –

답변

관련 문제