2017-11-14 7 views
0

私はxcodeを使い始めていないので、このレポートからアプリがクラッシュする理由をどのように伝えるべきか分かりません。 「プロジェクトで開く」をクリックすると、コード内の場所に移動し、作業する情報がほとんどなくなります。 Picture of crash reportxcodeからクラッシュが発生している場所を理解する方法

- (void)didTapOnJobTableView:(UIGestureRecognizer *)recognizer { 
CGPoint tapLocation = [recognizer 
locationInView:self.tableViewJobList]; 
NSIndexPath *indexPath = [self.tableViewJobList 
indexPathForRowAtPoint:tapLocation]; 
if (indexPath && indexPath.row >= 0 && indexPath.row < 
[self.dispatchTable count]) { 
SDMobileAppDelegate *appDelegate = [SDMobileAppDelegate me]; 
Dispatch *d = [self.dispatchTable objectAtIndex:indexPath.row]; 
<<<<Last exception backtrace here 
if (d != nil && ![d isCancelled]) { 
    JobListTableViewCell *cell = (JobListTableViewCell *) 
[self.tableViewJobList cellForRowAtIndexPath:indexPath]; 
    CGPoint tapLocalzied = [recognizer locationInView:cell]; 
    if (CGRectContainsPoint([cell.labelPrts frame], tapLocalzied)) { 
    if ([d.prtsPckQty integerValue] > 0) { 
     dispatchForPartsPick = d; 
     NSMutableString *partsPickText = [NSMutableString 
stringWithString:@""]; 
     NSArray *list = [PartsPick getListFromDatabase:self.db 
forDispatch:dispatchForPartsPick]; 
     for (PartsPick *p in list) { 
     NSString *location = @""; 
     if (![Utilities isEmpty:p.binLoc]) { 
      location = [NSString stringWithFormat:@"[at %@]", p.binLoc]; 
     } 
     [partsPickText appendFormat:@"%@ %@ %@ %@\r\n", p.qty, 
location, [p.prtNmbr stringByTrimmingCharactersInSet:[NSCharacterSet 
whitespaceAndNewlineCharacterSet]], p.dscrptn]; 
     if (![Utilities isEmpty:p.notes]) { 
      [partsPickText appendFormat:@"%@\r\n", p.notes]; 
     } 
     [partsPickText appendString:@"\r\n"]; 
     } 
     [ShowTextViewController show:self request:SEGUE_PARTSPICK_PREVIEW 
header:[NSString stringWithFormat:lStr(@"PARTSPICK_PREVIEW"), 
dispatchForPartsPick.invNmbr] message:@"" defaultText:partsPickText 
editable:NO autoCap:UITextAutocapitalizationTypeNone delegate:nil]; 
    } else { 
     [Utilities showOkAlertWithTitle:lStr(@"PTA") 
andMessage:lStr(@"PARTSPICK_PREVIEW_NONE") onComplete:nil]; 
    } 
    } else { 
    if ([Utilities allowedToGoToJob: d]) { 
     appDelegate.selectedDispatch = [NSNumber 
numberWithLong:indexPath.row]; 
     self.tabBarController.selectedIndex = 1; 
    } else { 
     [Utilities showOkAlertWithTitle:@"Cannot Continue" 
andMessage:@"Cannot select until previous PVR is completed." 
onComplete:nil]; 
    } 
    } 
} else { 
    [Utilities showOkAlertWithTitle:lStr(@"PTA") 
andMessage:lStr(@"JOB_CANCELLED_CANNOT_SELECT") onComplete:nil]; 
    } 
} 
} 

ここで、上記本具体ジェスチャ認識部と、使用されるコードである。

- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:animated]; 
[self refresh]; 
XLog(@"Job List View will appear"); 

    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] 
initWithTarget:self action:@selector(didTapOnJobTableView:)]; 
[self.tableViewJobList addGestureRecognizer:tap]; 

// startup the ticker 
self.countdownTimer = [NSTimer scheduledTimerWithTimeInterval:1 
target:self selector:@selector(countdownTimer:) userInfo:nil 
repeats:YES]; 

SDMobileAppDelegate *appDelegate = [SDMobileAppDelegate me]; 
NSTimeInterval diff = [[appDelegate.refreshTimer fireDate] 
timeIntervalSinceNow]; 
if (diff > 60) { 
self.buttonForceRefresh.enabled = YES; 
self.buttonForceRefresh.titleLabel.enabled = YES; 
} 

[self setTimeCardStatus]; 
} 
+0

'JobListViewController'の' didTapOnJobTableView'メソッドは、クラッシュが起きている場所です。 'didTapOnJobTableView'メソッドが' JobListViewController'に存在するかどうかを調べましたか?それが理由かもしれません。 – KrishnaCA

+0

@ KrishnaCA、didTapOnJobTableViewは.hファイルに存在する必要がありますか?これはすでに.mファイル内のメソッドです。 – Alex

+0

.hファイルにする必要はありません。質問にコードを追加するなどの詳細情報を提供できますか? – KrishnaCA

答えて

0

で動作するように多くの情報を有しています。あなたはまだそれが何を意味するのか分かりません。

https://www.raywenderlich.com/10209/my-app-crashed-now-what-part-1

https://www.raywenderlich.com/10505/my-app-crashed-now-what-part-2

「認識できないセレクタ」または「に応答しない - があった、それは時々イライラする...

参照レイWenderlichのサイトとAppleのドキュメントには、デバッグ開始します「セレクタ」とは、呼び出されたオブジェクトが、呼び出ししようとしているメソッドを理解していないか、見つけられないことを意味します。

このメッセージがユーザーインターフェイスまたはインタラクションに関連している場合は、UI要素のIBOutletまたはIBActionをコードに接続するのを忘れたか、または名前の入力ミスがどこかにあることや、コールしようとしているが、呼び出されているオブジェクトに存在しない(または公開されていない)。

インターフェイスビルダーからクラスのコードに名前が一致し、メソッドdidTapOnJobTableViewが実際にクラスJobListViewControllerに存在することを確認してください。

関連する問題