[NSCFNumber _isNaturallyRTL]:无法识别的选择器发送到实例0x605ac10

时间:2010-12-27 11:48:54

标签: iphone crash callstack

我的应用程序崩溃了显示该关键字。没有错误和警告。有些身体可以帮助我吗?

这是显示的堆栈:

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

更新

这是代码:

-(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];

}

设置fileSize.text = sizes;

时代码崩溃

这是dealloc方法:

- (void)dealloc {

[fileSize release];

[super dealloc];

}

1 个答案:

答案 0 :(得分:4)

_isNaturallyRTLNSString的无证方法。我假设fileSizeUILabel,因此您需要为其NSString属性分配text。但是,fileManager返回的字典包含NSNumber对象,该对象包含NSFileSize值。因此,您将unsigned long long对象分配给NSNumber属性,这不起作用。

尝试NSString