2014-05-17 3 views
0

UIStoryboardSegue, NSException 응용 프로그램에는 약 25 개의 viewController가있는 스토리 보드가 있습니다. 모든 단서는이 것을 제외하고는 모두 작동합니다. 이것은 애플리케이션이 종료 댈러스 제외하고 엑스 코드 5.1간단한 푸시 UIStoryboardSegue가 실패하는 이유는 무엇입니까?

함께 :

2014-05-15 21:16:17.004 iHungryMePlus[18768:60b] -[EditRecipeViewController viewDidLoad] 
2014-05-15 21:16:17.060 iHungryMePlus[18768:60b] -[EditRecipeViewController viewWillAppear:]  [[self tableView] isEditing]=1 
2014-05-15 21:16:17.257 iHungryMePlus[18768:60b] -[EditRecipeViewController tableviewCellWithReuseIdentifier:] cell for Photo reuse = <UITableViewCell: 0x1770fd30; frame = (0 0; 320 44); layer = <CALayer: 0x1770fec0>> 
2014-05-15 21:16:42.804 iHungryMePlus[18768:60b] -[EditRecipeViewController tableView:cellForRowAtIndexPath:] created cell for Photo = <UITableViewCell: 0x1770fd30; frame = (0 0; 320 44); layer = <CALayer: 0x1770fec0>> 
2014-05-15 21:16:42.858 iHungryMePlus[18768:60b] -[EditRecipeViewController tableView:cellForRowAtIndexPath:] created cell for Photo = <UITableViewCell: 0x17713f60; frame = (0 0; 320 44); layer = <CALayer: 0x17713ef0>> 
2014-05-15 21:16:42.863 iHungryMePlus[18768:60b] -[EditRecipeViewController configureCell:forIndexPath:] indexPath=<NSIndexPath: 0x175d96a0> {length = 2, path = 5 - 1} 
2014-05-15 21:16:56.577 iHungryMePlus[18768:60b] TOP prepareForSegue: EDIT_RECIPE_ADDPHOTO 
2014-05-15 21:16:56.616 iHungryMePlus[18768:60b] new unique id ='IHM-18768-0BBD0DF4-F19E-4C88-AFD0-415E5EA01D96' 
2014-05-15 21:17:05.017 iHungryMePlus[18768:60b] -[EditRecipeViewController prepareForSegue:sender:] End EDIT_RECIPE_ADDPHOTO Prepare 
2014-05-15 21:17:10.150 iHungryMePlus[18768:60b] -[AddPhotoViewController viewDidLoad] 
2014-05-15 21:17:12.794 iHungryMePlus[18768:60b] -[AddPhotoViewController viewWillAppear:] 
2014-05-15 21:40:10.604 iHungryMePlus[18768:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' 
*** First throw call stack: 
(0x2e446fd3 0x38b8fccf 0x2e380f9d 0x30cf9c6f 0x30cf9aab 0x30cf9633 0x30d10f49 0x30d10b8d 0x30d10b25 0x30c62d79 0x308e062b 0x308dbe3b 0x308dbccd 0x308db6df 0x308db4ef 0x308d521d 0x2e4122a5 0x2e40fc49 0x2e40ff8b 0x2e37af4f 0x2e37ad33 0x3329c663 0x30cc616d 0xb6015 0x3909cab7) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

이 예외는 전무 오브젝트은 An NSArray를 첨가 한 것을 나타낸다.

EditRecipeViewController에서 Segue 식별자가있는 AddPhotoViewController로 푸시 segue가 있습니다. EDIT_RECIPE_ADDPHOTO AddPhotoVC의 모든 메소드 상단에 NSLog가 있습니다. Exception 전에 두 개만 인쇄됩니다.

  1. viewWillAppear에서의 viewDidLoad
  2. 에서 송신자 :

    else if([segue.identifier isEqualToString:@"EDIT_RECIPE_ADDPHOTO"]){ 
         AddPhotoViewController *destCntrlr = (AddPhotoViewController*)segue.destinationViewController; 
         Photo* aPhoto = [NSEntityDescription insertNewObjectForEntityForName:@"Photo" inManagedObjectContext:self.recipe.managedObjectContext]; //INSERT MO 
         [self setPhoto:aPhoto]; 
         DLog(@"INSERT:self.photo=%@",self.photo); 
          //NEED indexPath NOW 
         NSIndexPath *indexPath= (NSIndexPath *)sender; 
         [[self photo] setSortIndex:[NSNumber numberWithInt:indexPath.row]]; 
         NSString* stockName = [NSString stringWithFormat:@"Photo #%u", [indexPath indexAtPosition:1] + 1]; 
         [[self photo] setName:stockName]; 
         [[self photo] setModified:[NSDate date]]; 
         [[ self photo] setUid:[Photo calculateNewUniqueID]]; 
         [destCntrlr setPhoto:aPhoto]; 
         [destCntrlr setDelegate:self]; 
         [destCntrlr setRecipe:[self recipe]]; 
         DLog(@"End EDIT_RECIPE_ADDPHOTO Prepare"); 
    } 
    
    [self performSegueWithIdentifier:@"EDIT_RECIPE_ADDPHOTO" sender:indexPath]; 
    

    가 -prepareSegue이 코드 다음 :

SEGUE는 EditRecipeViewController에 사용 시도

AddPhoto보기가 나타나지 않습니다. AddRecipe 초기 장면 []의 상자를 선택하면 초기보기 컨트롤러이며 시작시보기가 올바르게 표시됩니다. NIB 파일을 사용하여 AddPhoto보기를 표시 할 수도 있습니다.

UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"AddPhotoID"]; 
[self presentViewController:vc animated:YES completion:nil]; 

내가이 스토리 보드/SEGUE의 문제에 대한 해결책을 추적하기 위해 무슨 짓을 : 나는 또한 사용하여 AddPhotoViewController을 넣을 수 있습니다? 내 코드에서 인스턴스에 대한

  • 확인 [은 insertObject : atIndex :]
  • 세트
  • 설정 기호 브레이크 포인트 캐치 모든 예외 브레이크 포인트를 설정 던져
  • 에 모든 예외 중단 점, [ NSArrary은 insertObject : atIndex :] 나는이 중단 점은 응용 프로그램을 중지하고 나는 문제를 찾기 위해 통과 할 수있는 스택을 표시 할 것으로 예상 모든 모듈

합니다. 난 단지 참조 :

https://www.dropbox.com/s/rhiz7g2792xu4nt/Screenshot%202014-05-16%2022.39.07.png

나는 날이 예외에 대한 해결책을 추적 할 수 있도록 로그 메시지를 찾을 수 없습니다. 디버그 로그를보고 있지만 예외에 대한 유용한 참조가 없습니다. 결국 위에 나열된 것만 볼 수 있습니다. 도와주세요. 읽기

많은 감사, 마크

이 아래 추가 정보입니다.

Paulw11 및 Ricky, 정말 감사드립니다.

대상 뷰의 속성 '사진'

은 다음과 같습니다

내가 검색
@property(nonatomic, strong) Photo* photo; 

(포함, 위해 사례 무시 : 배열) 전체 destinationController 구현 파일, 즉 AddPhotoViewController.m을. 이 검색에서 어디에도 결과가 없습니다.

그래서 비슷한 문제에 대한 다음 답을 찾았습니다.

This is a fairly common error and it has three causes: 

Misspelling the entity name e.g. NewsStand instead of NewsStands. 
Having a nil managed object context 
Having no or the wrong managed object model loaded. 
(1) is the most common but (3) is more common than (2). You can check that you are loading the right model with the keypath: 

aManagedObjectContext.persistentStoreCoordinator.managedObjectModel.entities 
then check the entity's names. 

AddPhotoViewController는 NSManagedObjectContext 또는 NSManagedObjectModel 중 하나에 대한 더 바르가 없습니다. 엔티티 이름의 철자가 "Photo"입니다. 대한 던져 설정 기호 브레이크 포인트에, 모든 예외 브레이크 포인트를 설정 캐치 에

세트 모든 예외 중단 점 :

나는 다음 브레이크 포인트를 [: atIndex : NSArrary은 insertObject] 모든 모듈

에 대한 -viewWillAppear 스택의 끝에서

이 방법입니다

https://www.dropbox.com/s/ykmv1qsdnm3trbp/Screenshot%202014-05-20%2016.21.44.png 

그때 계속 클릭하고 스택은이 방법을 보이는

,536,913

https://www.dropbox.com/s/cuqd4qa9j249vxx/Screenshot%202014-05-20%2016.09.34.png 

SubListViewController : -prepareForSegue : 보낸 사람 :

https://www.dropbox.com/s/tvcvh4tvd0as5wl/Screenshot%202014-05-20%2016.08.16.png 

클릭 세 번째 스택이 지금 계속 : 63,210

https://www.dropbox.com/s/ladjxsfyafm0opu/Screenshot%202014-05-20%2016.04.43.png 

내가 두 번째와 스택을 계속 클릭을 보여줍니다

있다
if([segue.identifier isEqualToString:@"ADDRECIPE"]) { 
     AddRecipeViewController *destCntrlr = (AddRecipeViewController*)segue.destinationViewController; 
     [destCntrlr setDelegate:self]; //create and set delegate 
     CoreDataHelper *cdh = [CoreDataHelper sharedHelper]; 

     [cdh.context.undoManager beginUndoGrouping];//AddRx L:0 

     Recipe *aRecipe = 
     [NSEntityDescription insertNewObjectForEntityForName:@"Recipe" 
            inManagedObjectContext:[self.frc managedObjectContext]]; 
     // Recipe object created but still needs to be named. 
     // naming is done in NameRecipeViewController, which is reached 
     // from the AddRecipeViewController 

     DLog(@"aRecipe=%@",aRecipe); 
     [aRecipe setUid:[Photo calculateNewUniqueID]]; 
     [aRecipe setModified:[NSDate date]]; //creation date 

     destCntrlr.recipe = aRecipe; 
     [destCntrlr setSubListViewController:self]; 
     [destCntrlr setAppDelegate:self.appDelegate];//necessary?? 
     [destCntrlr setDelegate:self]; 

    } 

// 
// AddPhotoViewController.m 
// iHungryMePlus 
// 

#import "AddPhotoViewController.h" 
#import "AddPhotoTitleViewController.h" 
#import "CoreDataHelper.h" 
////#ifdef ICLOUD 
    //#import "SVProgressHUD.h" 
////#endif 

@implementation AddPhotoViewController 
@synthesize cancelButton, doneButton; 
@synthesize image,imageView; 
@synthesize recipe; 
@synthesize grabPhotoButton; 
@synthesize addTitleButton; 
@synthesize titleLabel; 
@synthesize recipePhotoDx; 
@synthesize photo; 
@synthesize delegate; 
@synthesize navigationItem , navigationBar; 
@synthesize isEditing; 
@synthesize loadFailedLabel; 
@synthesize activityIndicatorView; 

@synthesize cameraLibrarySegment; 
@synthesize cameraSelected; 
//@synthesize myPopover; 


#pragma mark PopupPassData protocol 

// 일부 방법 삭제 //

#pragma mark VIEW Observer 

- (void)observeValueForKeyPath:(NSString *)keyPath 
         ofObject:(id)object 
         change:(NSDictionary *)change 
         context:(void *)context { 

    if ([keyPath isEqualToString:@"self.imageView.image"]) { 
     [self.doneButton setEnabled: self.imageView.image != nil]; 
     [[self loadFailedLabel] setHidden:(BOOL)([[self imageView] image] != nil)]; 
    } 
} 

#pragma mark VIEW 

- (void)viewDidLoad { 
    DLog(@""); 
    [super viewDidLoad]; 

    [[self doneButton] setEnabled:NO]; 
    self.cameraSelected=YES; 

    [[self loadFailedLabel] setHidden:NO]; 

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleLowMemoryNotification:) 
      name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 

    [self addObserver:self 
         forKeyPath:@"self.imageView.image" 
         options:NSKeyValueObservingOptionNew 
         context:NULL]; 

} 

- (void)viewWillAppear:(BOOL)animated { 
    [super viewWillAppear:animated]; 
    DLog(@"Top"); 

    // after picking image this runs and then later the picker Delegate didFinishPickingMediaWithInfo: Moving to DidAppear: 
    [[self addTitleButton] setHidden:NO]; 
    [[self titleLabel] setText:[photo name]]; 
    if([photo image]){ 
     [[self imageView] setImage:[UIImage imageWithData:[photo image ]]]; 
    }else if([[photo filename ]length]){ 
     [[self imageView] setImage:[UIImage imageNamed:[photo filename]]]; 
    } 
    DLog(@"Final line in viewWillAppear."); 
} 

- (void)viewDidAppear:(BOOL) animated{ 
    [super viewDidAppear:animated]; 

    if(![self isEditing]) 
     [[self navigationItem] setTitle:@"Add Photo"];//insert 
    else { 
     [[self navigationItem] setTitle:@"Edit Photo"]; 
    } 
     //[[self navigationItem] setTitle:([self isEditing] ? @"Edit Photo" : @"Add Photo")]; 
    [[self cancelButton] setEnabled:YES]; 

    DLog(@"Final line in viewDidAppear."); 
} 

- (void)viewWillDisappear:(BOOL)animated { 
    [super viewWillDisappear:animated]; 
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; 

    [[self imageView] setImage:nil]; 
} 

- (void)viewDidUnload { 
     // Release any retained subviews of the main view. 
     // e.g. self.myOutlet = nil; 
    [self removeObserver:self forKeyPath:@"self.imageView.image"]; 

} 

- (IBAction)grabPhotoAction 
{ 
    UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init]; 
    // Create a popover, add the picker as the content view controller....viola. 
    imagePicker.delegate = self; //UIImagePickerControllerSourceTypeCamera 
           //UIImagePickerControllerSourceTypePhotoLibrary 
    imagePicker.sourceType = (cameraSelected) ? 
     UIImagePickerControllerSourceTypeCamera : UIImagePickerControllerSourceTypePhotoLibrary; 

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) 
    { 
     Class classPopoverController = NSClassFromString(@"UIPopoverController"); 
     if (classPopoverController) { // 3.2 or higher 
     /* 
      myPopover = [[classPopoverController alloc] initWithContentViewController:anImagePickerController]; 
      [myPopover presentPopoverFromRect:CGRectMake(419, 880, 127, 38) 
                  inView:self.view permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES]; 
      [(UIPopoverController*)popoverController setDelegate:self]; 
      // Store the popover in a custom property for later use. 
      //[self setPopoverController:aPopoverController]; 
      */ 
     } 
    }else { 
     [self presentViewController:imagePicker animated:YES completion:NULL]; 
     //[self performSegueWithIdentifier:@"GrabPhoto" sender:self]; 
    } 
     //#endif 

} 

- (IBAction)addTitleAction {//add or edit 

     [self performSegueWithIdentifier:@"PHOTOTITLE" sender:self]; 
     //[self presentViewController:self.addPhotoTitleViewController animated:YES completion:NULL]; 
} 


#pragma mark SEGUE 

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ 

    NSLog(@"prepareForSegue: %@", segue.identifier); 
    if([segue.identifier isEqualToString:@"PHOTOTITLE"]) { 
     AddPhotoTitleViewController *destCntrlr = (AddPhotoTitleViewController*)segue.destinationViewController; 
     [destCntrlr setIsEditing:[self isEditing]]; 
     //[destCntrlr setParentDoneBarButton:doneButton]; 
     [destCntrlr setPhoto:photo]; 
     [destCntrlr setTitleParentLabel:[self titleLabel]]; 
     [destCntrlr setRecipe :[self recipe]]; 
    } 
    else { 
     DLog(@"Can not find segue where segue.identifier=%@",segue.identifier); 
    } 
} 


#pragma mark UITextFieldDelegate 

- (BOOL)textFieldShouldReturn:(UITextField *)textField{ 
    //[[self titleTextField] resignFirstResponder]; 
    return YES; 
} 

    // Release any retained subviews of the main view. 
    // e.g. self.myOutlet = nil; 
#pragma mark Orientation delegate methods 

- (BOOL)shouldAutorotateToInterfaceOrientation: 
(UIInterfaceOrientation)interfaceOrientation { 
    return YES; 
} 

강력한 텍스트 @end

종료 :

클릭 네 번째와 다섯 번째 시간을 계속 우리가보고 마지막으로 예외에 볼

2014년 5월 20일 (16) : 10 : 22.374 iHungryMePlus [25337 : 60b] * 캐치되지 않은 예외 'NSInvalidArgumentException'으로 인해 앱 종료 중, 이유 : '* - [__ NSArrayM insertObject : atIndex :] : obj (0x2e446fd3 0x38b8fccf 0x2e380f9d 0x30cf9c6f 0x30cf9aab 0x30cf9633 0x30d10f49 0x30d10b8d 0x30d10b25 0x30c62d79 0x308e062b 0x308dbe3b 0x308dbccd 0x308db6df 0x308db4ef 0x308d521d 0x2e4122a5 0x2e40fc49 0x2e40ff8b 0x2e37af4f 0x2e37ad33 0x3329c663 0x30cc616d 0x13959d 0x3909cab7) 의 libC++ ABI : 요법은 ' * 먼저 던져 호출 스택 전무가 될 수 없습니다.dylib : 입력 NSException의 캐치되지 제외 종료

다섯째이 계속 후 스택은 :

https://www.dropbox.com/s/jjyuz0kjxgy7qnr/Screenshot%202014-05-20%2016.12.24.png

전체 디버그 로그 다음 :

코드 윤곽의 흐름은 다음

1. Home (RootTableViewController) TV shows list of Recipe categories. 
2. Selection of category on RTVC -> display SubListViewController (list of Rxs for the category) 
3. Touch Edit button to reach Edit Recipe Mode, which includes display of '+' button to reach 
AddRecipeVC. 
4. User is force to enter Name of Rx before proceeding. 
5. I then touch Add Photo button -> (AddPhotoVC) for this new Recipe object and the problems ensue. 

iHungryMePlus(25395,0x3b0e518c) malloc: stack logs being written into /tmp/stack-logs.25395.1b5000.iHungryMePlus.Hr5XtA.index 
iHungryMePlus(25395,0x3b0e518c) malloc: recording malloc and VM allocation stacks to disk using standard recorder 
iHungryMePlus(25395,0x3b0e518c) malloc: process 25370 no longer exists, stack logs deleted from /tmp/stack-logs.25370.108000.iHungryMePlus.ZicUAe.index 
2014-05-20 16:19:39.611 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate application:didFinishLaunchingWithOptions:] 
Bundle bundleVer=4.5.0 
defaultsVer=4.5.0 
2014-05-20 16:19:39.623 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate applicationDocumentsDirectoryPath] Running iHungry_MeAppDelegate 'applicationDocumentsDirectoryPath' 
/var/mobile/Applications/CF17E960-FA49-425A-91ED-1F76A845E8A3/Documents 
2014-05-20 16:19:39.628 iHungryMePlus[25395:60b] bICloudSupport=0 
2014-05-20 16:19:39.632 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate application:didFinishLaunchingWithOptions:] Bottom AppDelegate. 
2014-05-20 16:19:39.718 iHungryMePlus[25395:60b] -[RootTableViewController viewDidLoad] 
2014-05-20 16:19:39.722 iHungryMePlus[25395:60b] -[RootTableViewController configureFetch] Running RootTableViewController 'configureFetch' 
2014-05-20 16:19:39.779 iHungryMePlus[25395:60b] Running CoreDataHelper 'listenForStoreChanges' 
2014-05-20 16:19:39.786 iHungryMePlus[25395:60b] ** iCloud is DISABLED in Settings ** 
2014-05-20 16:19:39.790 iHungryMePlus[25395:60b] Running CoreDataHelper 'setDefaultDataStoreAsInitialStore' 
2014-05-20 16:19:39.828 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate applicationDocumentsDirectoryPath] Running iHungry_MeAppDelegate 'applicationDocumentsDirectoryPath' 
/var/mobile/Applications/CF17E960-FA49-425A-91ED-1F76A845E8A3/Documents 
2014-05-20 16:19:39.890 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate applicationDocumentsDirectoryPath] Running iHungry_MeAppDelegate 'applicationDocumentsDirectoryPath' 
/var/mobile/Applications/CF17E960-FA49-425A-91ED-1F76A845E8A3/Documents 
2014-05-20 16:19:39.898 iHungryMePlus[25395:60b] -[CoreDataHelper isMigrationNecessaryForStore:] storeUrl=file:///var/mobile/Applications/CF17E960-FA49-425A-91ED-1F76A845E8A3/Documents/Stores/IHM_Recipes.sqlite 
2014-05-20 16:19:39.929 iHungryMePlus[25395:60b] SKIPPED MIGRATION: Source is already compatible 
2014-05-20 16:19:39.934 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate applicationDocumentsDirectoryPath] Running iHungry_MeAppDelegate 'applicationDocumentsDirectoryPath' 
/var/mobile/Applications/CF17E960-FA49-425A-91ED-1F76A845E8A3/Documents 
2014-05-20 16:19:39.987 iHungryMePlus[25395:60b] Running CoreDataHelper 'storesDidChange:' 
2014-05-20 16:19:39.991 iHungryMePlus[25395:60b] -[CoreDataHelper storesDidChange:] responding to notification storesDidCh by posting SomethingChanged note. 
2014-05-20 16:19:39.996 iHungryMePlus[25395:60b] Successfully added store: <NSSQLCore: 0x1659ad60> (URL: file:///var/mobile/Applications/CF17E960-FA49-425A-91ED-1F76A845E8A3/Documents/Stores/IHM_Recipes.sqlite) 
2014-05-20 16:19:40.004 iHungryMePlus[25395:60b] ** iCloud is DISABLED in Settings ** 
2014-05-20 16:19:40.015 iHungryMePlus[25395:60b] -[RootTableViewController numberOfSectionsInTableView:] sectionCnt=0 
2014-05-20 16:19:40.019 iHungryMePlus[25395:60b] -[RootTableViewController numberOfSectionsInTableView:] sectionCnt=0 
2014-05-20 16:19:40.062 iHungryMePlus[25395:60b] -[CoreDataTVC performFetch] 
2014-05-20 16:19:40.067 iHungryMePlus[25395:60b] -[CoreDataTVC performFetch] RTVC 
2014-05-20 16:19:40.113 iHungryMePlus[25395:60b] -[RootTableViewController numberOfSectionsInTableView:] sectionCnt=6 
2014-05-20 16:19:40.118 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 5 Cnt=2 
2014-05-20 16:19:40.123 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 0 Cnt=1 
2014-05-20 16:19:40.128 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 1 Cnt=1 
2014-05-20 16:19:40.133 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 2 Cnt=1 
2014-05-20 16:19:40.138 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 3 Cnt=3 
2014-05-20 16:19:40.143 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 4 Cnt=1 
2014-05-20 16:19:40.185 iHungryMePlus[25395:60b] __27-[CoreDataTVC performFetch]_block_invoke reloadData completed 
2014-05-20 16:19:40.189 iHungryMePlus[25395:60b] -[RootTableViewController viewWillAppear:] doDisplayHUD=0 
2014-05-20 16:19:40.194 iHungryMePlus[25395:60b] ** iCloud is DISABLED in Settings ** 
2014-05-20 16:19:40.219 iHungryMePlus[25395:60b] -[RootTableViewController numberOfSectionsInTableView:] sectionCnt=6 
2014-05-20 16:19:40.224 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 5 Cnt=2 
2014-05-20 16:19:40.229 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 0 Cnt=1 
2014-05-20 16:19:40.233 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 1 Cnt=1 
2014-05-20 16:19:40.238 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 2 Cnt=1 
2014-05-20 16:19:40.243 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 3 Cnt=3 
2014-05-20 16:19:40.247 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 4 Cnt=1 
2014-05-20 16:19:40.368 iHungryMePlus[25395:60b] -[iHungry_MeAppDelegate applicationDidBecomeActive:] 
2014-05-20 16:19:40.531 iHungryMePlus[25395:60b] -[RootTableViewController viewDidAppear:] Running RootTableViewController 'viewDidAppear:' 
2014-05-20 16:20:40.097 iHungryMePlus[25395:60b] -[RootTableViewController tableView:didSelectRowAtIndexPath:] Category.name=Desserts 
2014-05-20 16:20:40.109 iHungryMePlus[25395:60b] prepareForSegue: SLVC 
2014-05-20 16:20:40.114 iHungryMePlus[25395:60b] -[RootTableViewController prepareForSegue:sender:] Selected category=Desserts 
2014-05-20 16:20:40.150 iHungryMePlus[25395:60b] -[CoreDataTVC configureSearch] 
2014-05-20 16:20:40.164 iHungryMePlus[25395:60b] -[SubListViewController numberOfSectionsInTableView:] 
2014-05-20 16:20:40.372 iHungryMePlus[25395:60b] -[SubListViewController numberOfSectionsInTableView:] 
2014-05-20 16:20:40.397 iHungryMePlus[25395:60b] -[SubListViewController configureFetch] Running SubListViewController 'configureFetch' 
2014-05-20 16:20:40.403 iHungryMePlus[25395:60b] -[CoreDataTVC performFetch] 
2014-05-20 16:20:40.407 iHungryMePlus[25395:60b] -[CoreDataTVC performFetch] SLVC 
2014-05-20 16:20:40.461 iHungryMePlus[25395:60b] -[SubListViewController numberOfSectionsInTableView:] 
2014-05-20 16:20:40.504 iHungryMePlus[25395:60b] __27-[CoreDataTVC performFetch]_block_invoke reloadData completed 
2014-05-20 16:20:40.511 iHungryMePlus[25395:60b] ** iCloud is DISABLED in Settings ** 
2014-05-20 16:20:40.519 iHungryMePlus[25395:60b] -[SubListViewController viewWillAppear:] [[self.frc fetchedObjects] count]=12 
2014-05-20 16:20:40.524 iHungryMePlus[25395:60b] -[SubListViewController viewWillAppear:] @ self.motionManager.deviceMotionActive=0 
2014-05-20 16:20:40.531 iHungryMePlus[25395:60b] -[SubListViewController numberOfSectionsInTableView:] 
2014-05-20 16:20:41.302 iHungryMePlus[25395:60b] -[SubListViewController viewDidAppear:] Running SubListViewController 'viewDidAppear:' 
2014-05-20 16:20:41.309 iHungryMePlus[25395:60b] ** iCloud is DISABLED in Settings ** 
2014-05-20 16:20:44.528 iHungryMePlus[25395:60b] -[SubListViewController numberOfSectionsInTableView:] 
2014-05-20 16:20:46.164 iHungryMePlus[25395:60b] prepareForSegue: ADDRECIPE 
2014-05-20 16:20:46.189 iHungryMePlus[25395:60b] -[SubListViewController prepareForSegue:sender:] aRecipe=<Recipe: 0x166f22a0> (entity: Recipe; id: 0x166f3760 <x-coredata:///Recipe/tEC40BCE6-61A1-45D2-B092-0A69DEB101D42> ; data: { 
    categories =  (
    ); 
    comments = nil; 
    ctime = 0; 
    directions = nil; 
    firstLetter = nil; 
    ingredients = nil; 
    modified = "1970-01-01 12:00:00 +0000"; 
    name = nil; 
    nameShort = nil; 
    photos =  (
    ); 
    ptime = 0; 
    recipeID = 0; 
    uid = nil; 
}) 
2014-05-20 16:20:46.194 iHungryMePlus[25395:60b] new unique id ='IHM-25395-0DD78F88-E819-43B4-9012-02DB9FDE8301' 
2014-05-20 16:20:52.791 iHungryMePlus[25395:60b] -[AddRecipeViewController prepareForSegue:sender:] segue.identifier:NAMERECIPE 
2014-05-20 16:20:52.795 iHungryMePlus[25395:60b] -[AddRecipeViewController prepareForSegue:sender:] nameRecipeViewController=<NameRecipeViewController: 0x1663a350> 
2014-05-20 16:20:55.583 iHungryMePlus[25395:60b] -[NameRecipeViewController textField:shouldChangeCharactersInRange:replacementString:] editLengthB4 = 0 
range.length =0 
replaceStrLen=1 
2014-05-20 16:20:55.587 iHungryMePlus[25395:60b] -[NameRecipeViewController textField:shouldChangeCharactersInRange:replacementString:] Length=1 
2014-05-20 16:20:56.015 iHungryMePlus[25395:60b] -[NameRecipeViewController textField:shouldChangeCharactersInRange:replacementString:] editLengthB4 = 1 
range.length =0 
replaceStrLen=1 
2014-05-20 16:20:56.019 iHungryMePlus[25395:60b] -[NameRecipeViewController textField:shouldChangeCharactersInRange:replacementString:] Length=2 
2014-05-20 16:20:56.365 iHungryMePlus[25395:60b] -[NameRecipeViewController textField:shouldChangeCharactersInRange:replacementString:] editLengthB4 = 2 
range.length =0 
replaceStrLen=1 
2014-05-20 16:20:56.369 iHungryMePlus[25395:60b] -[NameRecipeViewController textField:shouldChangeCharactersInRange:replacementString:] Length=3 
2014-05-20 16:20:57.837 iHungryMePlus[25395:60b] -[AddRecipeViewController tableviewCellWithReuseIdentifier:] Add Photo cell for Photo reuse = <UITableViewCell: 0x167c0590; frame = (0 0; 320 44); layer = <CALayer: 0x167c0720>> 
2014-05-20 16:20:57.844 iHungryMePlus[25395:60b] -[AddRecipeViewController configureCell:forIndexPath:] indexPath=<NSIndexPath: 0x167c0580> {length = 2, path = 5 - 0} 
2014-05-20 16:20:57.850 iHungryMePlus[25395:60b] -[AddRecipeViewController configureCell:forIndexPath:] cell=<UITableViewCell: 0x167c0590; frame = (0 0; 320 44); text = 'add photo'; layer = <CALayer: 0x167c0720>> 
2014-05-20 16:20:57.985 iHungryMePlus[25395:60b] -[CoreDataTVC controllerWillChangeContent:] 
2014-05-20 16:20:57.989 iHungryMePlus[25395:60b] -[CoreDataTVC controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:] 
2014-05-20 16:20:57.993 iHungryMePlus[25395:60b] -[CoreDataTVC controllerDidChangeContent:] 
2014-05-20 16:20:57.997 iHungryMePlus[25395:60b] -[RootTableViewController numberOfSectionsInTableView:] sectionCnt=6 
2014-05-20 16:20:58.001 iHungryMePlus[25395:60b] -[RootTableViewController numberOfSectionsInTableView:] sectionCnt=6 
2014-05-20 16:20:58.005 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 0 Cnt=1 
2014-05-20 16:20:58.009 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 1 Cnt=1 
2014-05-20 16:20:58.013 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 2 Cnt=1 
2014-05-20 16:20:58.016 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 3 Cnt=3 
2014-05-20 16:20:58.021 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 4 Cnt=1 
2014-05-20 16:20:58.029 iHungryMePlus[25395:60b] -[RootTableViewController tableView:numberOfRowsInSection:] rowsInSection 5 Cnt=2 
2014-05-20 16:21:16.090 iHungryMePlus[25395:60b] -[AddRecipeViewController prepareForSegue:sender:] segue.identifier:ADDPHOTO 
2014-05-20 16:21:16.093 iHungryMePlus[25395:60b] -[AddRecipeViewController prepareForSegue:sender:] beginUndoGrouping]; //AddRx.AddPhoto L:1 
2014-05-20 16:21:16.103 iHungryMePlus[25395:60b] new unique id ='IHM-25395-5B4352A6-D3BB-4922-A1CF-008B388CA3C3' 
2014-05-20 16:21:16.144 iHungryMePlus[25395:60b] -[AddPhotoViewController viewDidLoad] 
2014-05-20 16:21:20.907 iHungryMePlus[25395:60b] -[AddPhotoViewController viewWillAppear:] Top 
2014-05-20 16:22:32.161 iHungryMePlus[25395:60b] -[AddPhotoViewController viewWillAppear:] Final line in viewWillAppear. 
2014-05-20 16:22:40.087 iHungryMePlus[25395:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil' 
*** First throw call stack: 
(0x2e446fd3 0x38b8fccf 0x2e380f9d 0x30cf9c6f 0x30cf9aab 0x30cf9633 0x30d10f49 0x30d10b8d 0x30d10b25 0x30c62d79 0x308e062b 0x308dbe3b 0x308dbccd 0x308db6df 0x308db4ef 0x30c66401 0x2e41225b 0x2e41172b 0x2e40ff1f 0x2e37af4f 0x2e37ad33 0x3329c663 0x30cc616d 0x13a775 0x3909cab7) 
libc++abi.dylib: terminating with uncaught exception of type NSException 
(lldb) 
+5

로그에 'prepareForSegue'가 끝났고 대상보기 컨트롤러에서'viewWillAppear'을 실행 했으므로 제공 한 코드 중 어느 것도 예외와 직접적으로 관련이 없습니다. 대상 뷰 컨트롤러에서 배열 조작을 살펴야합니다. 목적지 컨트롤러의 속성, 특히'aPhoto'는 어떻게 선언됩니까? 이것은'prepareForSegue'의 로컬 변수입니다. 그래서 목적지가'weak'이면 nil로 끝날 것입니다. – Paulw11

+0

Paulw11과 동의합니다. 확실히 Array와 관련이 있습니다. – Ricky

답변

0

바보 ViewController에 NavigationItem을 추가했습니다!

Apple Developer Tech Support에서 TSI로 바꾸어서 알게되었습니다.

기술 썼다 :

이보기 컨트롤러 다시를 상속 AddPhotoViewController.m

그래서
@synthesize navigationItem; 

에서이 줄뿐만 아니라 AddPhotoViewController.h

에서
@property(nonatomic, retain) UINavigationItem* navigationItem; 

을이 줄을 제거 표준 행동.