2014-10-01 2 views
0

iOS SDK 8.0으로 업데이트되었습니다. backened로 parse.com 사용iOS SDK 8.0으로 업데이트하면 앱이 다운 됨

- (void)retrieveMessages { 
PFQuery *query = [PFQuery queryWithClassName:@"Messages"]; 
[query whereKey:@"recipientIds" equalTo:[[PFUser currentUser] objectId]]; 
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { 
    if (error) { 
     NSLog (@"Error:%@ %@", error, [error userInfo]); 

    } 
    else { 
     //we found messages 
     self.messages = objects; 
     [self.tableView reloadData]; 
     NSLog (@"Retrieved %d messages", [self.messages count]); 

    } 

    if([self.refreshControl isRefreshing]) { 
     [self.refreshControl endRefreshing]; 
    } 
}]; 
} 



- (void)viewDidLoad 
{ 
[super viewDidLoad]; 

self.moviePlayer = [[MPMoviePlayerController alloc] init]; 

PFUser *currentUser = [PFUser currentUser]; 
if (currentUser){ 
    NSLog (@"CurrentUser:%@", currentUser.username); 
} 
else{ 

[self performSegueWithIdentifier:@"showLogin" sender:self]; 

} 

self.refreshControl = [[UIRefreshControl alloc] init]; 
[self.refreshControl addTarget:self action:@selector(retrieveMessages) forControlEvents:UIControlEventValueChanged]; 
    } 


- (void) viewWillAppear:(BOOL)animated { 

[super viewWillAppear:animated]; 

[self.navigationController.navigationBar setHidden:NO]; 

[self retrieveMessages]; 

} 

:

응용 프로그램 오류

[PFInternalUtils assertValidClassForQuery:] at PFInternalUtils.m:372 

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot do a comparison query for type: (null)' 
*** First throw call stack: 
(
    0 CoreFoundation      0x032d6df6 __exceptionPreprocess + 182 
1 libobjc.A.dylib      0x02f60a97 objc_exception_throw + 44 
2 CoreFoundation      0x032d6d1d +[NSException raise:format:] + 141 
3        0x000e60b2 +[PFInternalUtils assertValidClassForQuery:] + 324 
4         0x000ce3cb -[PFQuery whereKey:equalTo:] + 91 
5         0x000b7391 -[InboxViewController retrieveMessages] + 193 
6         0x000b624c -[InboxViewController viewWillAppear:] + 236 
7 UIKit        0x01aa614f -[UIViewController _setViewAppearState:isAnimating:] + 545 
8 UIKit        0x01aa66ca -[UIViewController __viewWillAppear:] + 148 
9 UIKit        0x01ad8389 -[UINavigationController _startTransition:fromViewController:toViewController:] + 931 
10 UIKit        0x01ad8fdb -[UINavigationController _startDeferredTransitionIfNeeded:] + 669 
11 UIKit        0x01ad9c52 -[UINavigationController __viewWillLayoutSubviews] + 57 
12 UIKit        0x01c4bebc -[UILayoutContainerView layoutSubviews] + 213 
13 UIKit        0x019d59c0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 608 
14 libobjc.A.dylib      0x02f76771 -[NSObject performSelector:withObject:] + 70 
15 QuartzCore       0x00c9827f -[CALayer layoutSublayers] + 152 
16 QuartzCore       0x00c8c105 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 397 
17 QuartzCore       0x00c8bf60 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26 
18 QuartzCore       0x00bea676 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284 
19 QuartzCore       0x00beba3c _ZN2CA11Transaction6commitEv + 392 
20 QuartzCore       0x00cb1789 +[CATransaction flush] + 52 
21 UIKit        0x019487e6 -[UIApplication _reportMainSceneUpdateFinished:] + 39 
22 UIKit        0x01949761 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3163 
23 UIKit        0x01961d30 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59 
24 UIKit        0x01947d7f -[UIApplication workspaceDidEndTransaction:] + 155 
25 FrontBoardServices     0x064069de __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71 
26 FrontBoardServices     0x0640646f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54 
27 FrontBoardServices     0x06418425 __31-[FBSSerialQueue performAsync:]_block_invoke + 26 
28 CoreFoundation      0x031fa7a0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16 
29 CoreFoundation      0x031f00b3 __CFRunLoopDoBlocks + 195 
30 CoreFoundation      0x031eff0b __CFRunLoopRun + 2715 
31 CoreFoundation      0x031ef1ab CFRunLoopRunSpecific + 443 
32 CoreFoundation      0x031eefdb CFRunLoopRunInMode + 123 
33 UIKit        0x01947744 -[UIApplication _run] + 571 
34 UIKit        0x0194ae16 UIApplicationMain + 1526 
35        0x000b567d main + 141 
36 libdyld.dylib      0x04dddac9 start + 1 
37 ???         0x00000001 0x0 + 1 
) 
libc++abi.dylib: terminating with uncaught exception of type NSException 

편집과 충돌합니다.

업데이트하기 전에 정상적으로 작동했습니다.

이 오류를 해결하는 방법을 알려주세요.

도움 주셔서 감사합니다.

+0

코드를 알려주시겠습니까? 또한 예외가 발생했습니다 :'NSInvalidArgumentException ', 이유 :'타입에 대한 비교 질의를 할 수 없습니다 : (null)'? – cybermonkey

+0

모든 인스턴트 메시지는 CoreFoundation + + [NSException raise : format :] – user1120133

+0

입니다 ** 귀하의 질문에 ** 전체 오류 로그 **를 붙여 넣으십시오 (예 : http://stackoverflow.com/questions/3847798/terminate-called- after-throwing-an-instance-of-nsexception-error-xcode)를 사용합니다. – cybermonkey

답변

2

이 오류는 사용자가 로그인해야하는 기능을 실행 중이므로 기능이 실행될 때 발생하는 것으로 보입니다. other questions에서 특정 오류는 4 0x000ce3cb -[PFQuery whereKey:equalTo:] + 91과 관련이있는 것 같습니다. 위의 링크 된 질문을 보면 문제의 전체 진술은 [PFQuery whereKey:equalTo:[PFUser currentUser]] 일 수 있습니다.

[query whereKey:@"recipientIds" equalTo:[[PFUser currentUser] objectId]]; 

으로 전에 말했듯이

, 당신은 사용자가 로그인하지 않은 경우 잡을 메인 코드를 방지해야합니다 다음 코드를 보면

는 문제의 근본의 코드입니다 함수에서 return을 추가하여 실행되지 않도록합니다. 링크 된 질문에서 답변

하나 :

난 그냥 이것으로 실행하고 내가 EqualTo가 수행하고 있었던 사실 때문하십시오 PFQuery에 [PFUser 경우 CurrentUser]하지만 로깅은 없었다 - 그 시점에서 사용자. 이것은 당신이 아이폰 OS 8 SDK (? 당신이 바로, 엑스 코드 6.0.1 & 최신 구문 분석 SDK를 사용하고), 잘 모르겠어요으로 업그레이드 할 때 발생하는 시작한 이유에

; 아마 그것은 업그레이드와 관련이 없으며이 오류가 발생하도록 변경했습니다.

관련 문제