问题描述
我基本上是直接把DEMO的东西复制过去然后改了改,各个功能基本都没问题,但是点击视频通话和语音通话没有反应,按理说我直接用的demo的,为什么会这样呢?还有点击头像闪退,这是log:*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil'*** First throw call stack:( 0 CoreFoundation 0x000000010d5d4e65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010d021deb objc_exception_throw + 48 2 CoreFoundation 0x000000010d4d26e2 -[__NSDictionaryM setObject:forKey:] + 1042 3 Èõ∑Èì≠ÁîµÂïÜ 0x0000000107245abb __74-[PFMultiProcessFileLockController beginLockedContentAccessForFileAtPath:]_block_invoke + 129 4 libdispatch.dylib 0x000000010e18d49b _dispatch_client_callout + 8 5 libdispatch.dylib 0x000000010e171fb5 _dispatch_barrier_sync_f_invoke + 393 6 Èõ∑Èì≠ÁîµÂïÜ 0x0000000107245a15 -[PFMultiProcessFileLockController beginLockedContentAccessForFileAtPath:] + 127 7 Èõ∑Èì≠ÁîµÂïÜ 0x0000000107267502 +[PFObject(Private) _objectFromDataFile:error:] + 203 8 Èõ∑Èì≠ÁîµÂïÜ 0x00000001072ab851 +[PFUser(Private) _getCurrentUserWithOptions:] + 611 9 Èõ∑Èì≠ÁîµÂïÜ 0x0000000107284770 -[PFQuery _user] + 72 10 Èõ∑Èì≠ÁîµÂïÜ 0x0000000107285b7a -[PFQuery _findObjectsAsyncForQueryState:after:] + 171 11 Èõ∑Èì≠ÁîµÂïÜ 0x000000010728575b -[PFQuery findObjectsInBackground] + 120 12 Èõ∑Èì≠ÁîµÂïÜ 0x000000010728593e -[PFQuery findObjectsInBackgroundWithBlock:] + 445 13 Èõ∑Èì≠ÁîµÂïÜ 0x0000000106a40368 -[UserProfileManager loadUserProfileInBackground:saveToLoacal:completion:] + 344 14 Èõ∑Èì≠ÁîµÂïÜ 0x0000000106a9ec8d -[UserProfileViewController loadUserProfile] + 605 15 Èõ∑Èì≠ÁîµÂïÜ 0x0000000106a9dae1 -[UserProfileViewController viewDidLoad] + 705 16 UIKit 0x000000010a849f98 -[UIViewController loadViewIfRequired] + 1198 17 UIKit 0x000000010a84ff4f -[UIViewController __viewWillAppear:] + 120 18 UIKit 0x000000010a87fe44 -[UINavigationController _startCustomTransition:] + 1203 19 UIKit 0x000000010a89023f -[UINavigationController _startDeferredTransitionIfNeeded:] + 712 20 UIKit 0x000000010a8913af -[UINavigationController __viewWillLayoutSubviews] + 57 21 UIKit 0x000000010aa37ff7 -[UILayoutContainerView layoutSubviews] + 248 22 UIKit 0x000000010a76a4a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703 23 QuartzCore 0x000000010a30659a -[CALayer layoutSublayers] + 146 24 QuartzCore 0x000000010a2fae70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366 25 QuartzCore 0x000000010a2facee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 26 QuartzCore 0x000000010a2ef475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277 27 QuartzCore 0x000000010a31cc0a _ZN2CA11Transaction6commitEv + 486 28 QuartzCore 0x000000010a31d37c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92 29 CoreFoundation 0x000000010d500367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23 30 CoreFoundation 0x000000010d5002d7 __CFRunLoopDoObservers + 391 31 CoreFoundation 0x000000010d4f5f2b __CFRunLoopRun + 1147 32 CoreFoundation 0x000000010d4f5828 CFRunLoopRunSpecific + 488 33 GraphicsServices 0x000000010e66ead2 GSEventRunModal + 161 34 UIKit 0x000000010a6b3610 UIApplicationMain + 171 35 Èõ∑Èì≠ÁîµÂïÜ 0x0000000106bf33bf main + 111 36 libdyld.dylib 0x000000010e1c292d start + 1 37 ??? 0x0000000000000001 0x0 + 1)libc++abi.dylib: terminating with uncaught exception of type NSException(lldb)
解决方案
setObjectForKey: key cannot be nil'这个方法中的键值为空