2010-12-27 5 views
1

내 앱이 크래시되어 해당 키워드가 표시되었습니다. 오류 및 경고가 없습니다. 어떤 몸이 나를 도울 수 있니?[NSCFNumber _isNaturallyRTL] : 인식 할 수없는 선택기가 인스턴스로 전송 됨 0x605ac10

-(void)viewWillAppear:(BOOL)animated{ 
DocSegmentedModel *docSegmentedModel = [docProperties objectAtIndex:index]; 
NSString *segmenid = docSegmentedModel.docSegmentId; 
NSFileManager *filemgr = [NSFileManager defaultManager]; 
NSDictionary *attribs; 
NSString *sizes; 

NSString *localFilePath = docSegmentedModel.docSegmentLocalPath; 
NSLog(@"segmen id : %@", segmenid); 

//get file name 
fileName.text = docSegmentedModel.docSegmentFileName; 

//get file size 
attribs = [filemgr attributesOfItemAtPath:localFilePath error:NULL]; 
sizes = [attribs objectForKey:@"NSFileSize"]; 


NSLog(@"local path : %@", localFilePath); 
NSLog(@"filesize : %@", sizes); 
    fileSize.text = sizes; 

[filemgr release]; 
[attribs release]; 

}

,369 :이 코드

Call stack at first throw: (
0 CoreFoundation      0x012ccbe9 __exceptionPreprocess + 185 
1 libobjc.A.dylib      0x014215c2 objc_exception_throw + 47 
2 CoreFoundation      0x012ce6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 
3 CoreFoundation      0x0123e366 ___forwarding___ + 966 
4 CoreFoundation      0x0123df22 _CF_forwarding_prep_0 + 50 
5 UIKit        0x0042d35e -[UITextField setText:] + 53 
6 MyApp        0x0006427a -[FilePropertiesViewController viewWillAppear:] + 442 
7 UIKit        0x003c4d52 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 207 
8 UIKit        0x003cfa2b -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 378 
9 UIKit        0x003cfa5c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 427 
10 UIKit        0x003cfa5c -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 427 
11 UIKit        0x003c6b36 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 370 
12 UIKit        0x003c514f -[UIView(Hierarchy) addSubview:] + 57 
13 UIKit        0x006ad8ae -[UIPopoverView presentFromRect:inView:contentSize:backgroundStyle:animated:] + 1920 
14 UIKit        0x006a0a4c -[UIPopoverView presentFromRect:inView:animated:] + 236 
15 UIKit        0x006d9b20 -[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:] + 1046 
16 MyApp        0x0001f90f -[codeViewController arrangeTabWithTypeGesture:andNumtag:] + 4683 
17 MyApp        0x0001e68f -[codeViewController setTap2:] + 99 
18 UIKit        0x0061e9c7 -[UIGestureRecognizer _updateGestureWithEvent:] + 727 
19 UIKit        0x0061a9d6 -[UIGestureRecognizer _delayedUpdateGesture] + 47 
20 UIKit        0x00620fa5 _UIGestureRecognizerUpdateObserver + 584 
21 UIKit        0x0062118a _UIGestureRecognizerUpdateGesturesFromSendEvent + 51 
22 UIKit        0x003bc6b4 -[UIWindow _sendGesturesForEvent:] + 1292 
23 UIKit        0x003b7f87 -[UIWindow sendEvent:] + 105 
24 UIKit        0x0039b37a -[UIApplication sendEvent:] + 447 
25 UIKit        0x003a0732 _UIApplicationHandleEvent + 7576 
26 GraphicsServices     0x0191fa36 PurpleEventCallback + 1550 
27 CoreFoundation      0x012ae064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
28 CoreFoundation      0x0120e6f7 __CFRunLoopDoSource1 + 215 
29 CoreFoundation      0x0120b983 __CFRunLoopRun + 979 
30 CoreFoundation      0x0120b240 CFRunLoopRunSpecific + 208 
31 CoreFoundation      0x0120b161 CFRunLoopRunInMode + 97 
32 GraphicsServices     0x0191e268 GSEventRunModal + 217 
33 GraphicsServices     0x0191e32d GSEventRun + 115 
34 UIKit        0x003a442e UIApplicationMain + 1160 
35 MyApp        0x00002680 main + 102 
36 MyApp        0x00002611 start + 53 
37 ???         0x00000001 0x0 + 1 

)

업데이트 :

이 보였다 스택 인

fileSize.text = sizes를 설정하면 코드가 충돌합니다.

- (void)dealloc { 

[fileSize release]; 

[super dealloc]; 

}

+0

코드가 충돌하는 부분에서 코드를 추가하십시오. – iPrabu

답변

4

_isNaturallyRTLNSString의 문서화 방법 :

는 할당 해제의 방법이다. 나는 fileSizeUILabel이라고 가정하고 text 속성에 NSString을 할당해야한다고 가정합니다. 그러나 fileManager에서 반환 한 사전에는 unsigned long long 값이 포함 된 NSFileSize 키의 NSNumber 객체가 들어 있습니다. 따라서 NSNumber 개체를 NSString 속성에 할당하면 작동하지 않습니다.

시도 fileSize.text = [sizes stringVlue];.

+0

owhhh ... 대단히 감사합니다. Bjorn ... 알아 냈습니다! 해결 됐어 ... 고마워. –

관련 문제