2010-10-17 171 views
6

我看到这篇日志在控制台当我运行我的应用程序:CALayer的位置包含楠:[楠-0.5]

CALayer position contains NaN: [nan -0.5] 

该应用程序包括一个UITaBar其中的第一个标签是UINavigationController的。在NavController我启动AddressBookPicker。在AddressBookPicker我只选择显示电话号码。

当我选择一个只有电子邮件地址的联系人时,就是当我看到这个日志。

我没有看到任何崩溃或任何问题,只是将日志打印到控制台上。想要确保这不是在发布后崩溃的隐藏问题。

下面是相关代码和堆栈跟踪的片段。不确定代码的其他部分要粘贴在这里,请让我知道是否有任何我可以发布可能有帮助。

任何帮助/投入赞赏。

谢谢!

代码

ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init]; 

NSArray *displayedItems = [NSArray arrayWithObjects: [NSNumber numberWithInt:kABPersonPhoneProperty]), nil]; 

picker.displayedProperties = displayedItems; 

picker.peoplePickerDelegate = self; 

[self presentModalViewController:picker animated:YES]; 

堆栈跟踪

#0 0x00096377 in NSLog 

#1 0x046b38c9 in CALayerSetPosition 

#2 0x046b3846 in -[CALayer setPosition:] 

#3 0x046b375f in -[CALayer setFrame:] 

#4 0x002f510b in -[UIView(Geometry) setFrame:] 

#5 0x003dbe6d in -[UILabel setFrame:] 

#6 0x023ed095 in -[ABPersonTableViewDataSource reloadNoValueLabelAnimated:] 

#7 0x0244cf53 in -[ABPersonTableViewDataSource reloadDataIncludingHeaderView:invalidatePropertyData:] 

#8 0x023f30d4 in -[ABPersonTableViewDataSource reloadDataIncludingHeaderView:] 

#9 0x023eabc9 in -[ABPersonViewControllerHelper prepareViewWithDisplayedProperties:person:allowActions:] 

#10 0x023ea6bc in -[ABPersonViewControllerHelper loadViewWithDisplayedProperties:person:allowDeletion:allowActions:] 

#11 0x023ea598 in -[ABPersonViewController loadView] 

#12 0x0036a54f in -[UIViewController view] 

#13 0x003689f4 in -[UIViewController contentScrollView] 

#14 0x003787e2 in -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] 

#15 0x00376ea3 in -[UINavigationController _layoutViewController:] 

#16 0x0037812d in -[UINavigationController _startTransition:fromViewController:toViewController:] 

#17 0x00372ccd in -[UINavigationController _startDeferredTransitionIfNeeded] 

#18 0x00379d8b in -[UINavigationController pushViewController:transition:forceImmediate:] 

#19 0x00372b67 in -[UINavigationController pushViewController:animated:] 

#20 0x02403bc2 in -[ABPeoplePickerNavigationController pushViewController:animated:] 

#21 0x0242a424 in -[ABPeoplePickerNavigationController showCardForPerson:withMemberCell:animate:forceDisableEditing:personViewController:] 

#22 0x0242ce20 in -[ABMembersViewController showCardForPerson:withMemberCell:animate:] 

#23 0x0240a0ef in -[ABMembersController abDataSource:selectedPerson:atIndexPath:withMemberCell:animate:] 

#24 0x023fdb47 in -[ABMembersDataSource tableView:didSelectRowAtIndexPath:] 

#25 0x00333a48 in -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] 

#26 0x0032a32e in -[UITableView _userSelectRowAtIndexPath:] 

#27 0x0003f21a in __NSFireDelayedPerform 

#28 0x02631f73 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ 

#29 0x026335b4 in __CFRunLoopDoTimer 

#30 0x0258fdd9 in __CFRunLoopRun 

#31 0x0258f350 in CFRunLoopRunSpecific 

#32 0x0258f271 in CFRunLoopRunInMode 

#33 0x02f2f00c in GSEventRunModal 

#34 0x02f2f0d1 in GSEventRun 

#35 0x002ceaf2 in UIApplicationMain 

#36 0x00002554 in main at main.m:14 
+0

嗨丹尼,你有没有找到解决这个问题的办法?我得到了同样的错误信息,都是用不同的nan值(?)。任何导致它的原因是什么? – epologee 2011-07-07 12:09:22

回答

0
  1. 我不知道。

  2. 我也看到了 - 我正在做点什么完全是与你不同 - 我使用route-me映射引擎来显示可滚动的地图。

相信它是与滚动看法 - 并以某种方式参与滚动层。正如你提到的一些观点我认为是滚动的 - 这将同意我的观察。

我希望我有更多的数据给你,但是有一点我可以告诉你的是,我一直在努力的应用为个月,并在iPhone和iPad,设备和模拟器一直在测试它,在操作系统3.2和4.0下 - 并没有崩溃或内存泄漏[完全或与此相关]。

所以总之 - 没有想法 - 但我认为你没事!

+0

很高兴知道它不会导致问题。在开发者社区没有得到回应。 – dagnytaggart 2010-10-26 00:10:39

1

这似乎现在导致在iOS 4.2崩溃。尝试选择没有电话号码的联系人,您应该转到显示“没有电话号码”的视图。当你回到所有联系人然后再次选择该联系人时发生崩溃。

是否有其他人遇到此问题?

编辑:在我的情况下,我只显示电子邮件地址。在没有电子邮件地址的情况下选择联系人会导致崩溃。

+0

对我来说同样的问题。 – Andrei 2011-02-17 11:02:05

1

我有同样的问题,虽然它似乎没有发生在内置的应用程序(如邮件)。

一个稍有hackish的解决方法是将第一个和最后名称添加到显示的属性列表 - 它并不显示在这种情况下,“无电子邮件地址”层,也不会崩溃。

1

我有同样的问题,“CALayer的位置包含楠:”。该应用在iOS3.x和iOS4.1设备中表现不错,但在iOS4.2中崩溃。

在我的情况,我有以下代码:

CGRect frame; 
frame.size.height = kTableCellHeight - 11; 
frame.size.width = widthCell - 30; 

UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:frame]; 

的的UILabel创建失败,并显示错误。对我来说,这是解决了frame.origin将任意值(此的UILabel目的,这并不重要)

CGRect frame; 
frame.size.height = kTableCellHeight - 11; 
frame.size.width = widthCell - 30; 
frame.origin.x = 0; 
frame.origin.y = 0; 

UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:frame]; 

也许用“CALayer的位置包含NAN”的问题,是因为一些零,不完整或未定义的值或结构正在被使用。