[英]Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument'
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString stringByAppendingString:]: nil argument' iam getting this error help me out.. 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'***-[__ NSCFConstantString stringByAppendingString:]:nil参数'Iam收到此错误可以帮助我。
- (IBAction)sendAction:(id)sender
{
if([_chatTextField.text length] > 0)
{
NSString* po = getUser.ofUser;
bubbleTable.typingBubble = NSBubbleTypingTypeNobody;
NSBubbleData *messageBubble = [NSBubbleData dataWithText:_chatTextField.text date:[NSDate dateWithTimeIntervalSinceNow:0] type:BubbleTypeMine];
[bubbleData addObject:messageBubble];
[bubbleTable reloadData];
[bubbleTable scrollBubbleViewToBottomAnimated:YES];
NSLog(@"getuserAccount:%@", getUser.account);
NSLog(@"TextField:%@", _chatTextField.text);
NSLog(@"Po:%@", po);
NSLog(@"UserID:%@", [NSString stringWithFormat:@"%ld", (long)getUser.Id]);
NSLog(@"chatMessageKey:%@", chatMessageKey);
[[QuoteMessageController SharedInstance] SendChatMessageTo:getUser.account withContent:_chatTextField.text toUserId:[NSString stringWithFormat:@"%ld", (long)getUser.Id] andOFId:po andVerifyKey:chatMessageKey];
}
//[self StopInteraction];
}
outPut Iam getting is.. 我是outPut Iam。
> userAccount:(null)
> 2015-01-12 19:09:26.050 SourceSage[6842:737878] TextField:haii
> 2015-01-12 19:09:26.051 SourceSage[6842:737878] Po:(null)
> 2015-01-12 19:09:26.052 SourceSage[6842:737878] UserID:0
> 2015-01-12 19:09:26.052 SourceSage[6842:737878] chatMessageKey:2365891
> 2015-01-12 19:09:44.240 SourceSage[6842:737878] dbPath:/var/mobile/Containers/Data/Application/C06E4910-88B7-46BF-A7A9-8FBDCDA44B67/Documents/Recipes/SourceSageDB.db
> 2015-01-12 19:09:44.264 SourceSage[6842:737878] dbPath:/var/mobile/Containers/Data/Application/C06E4910-88B7-46BF-A7A9-8FBDCDA44B67/Documents/Recipes/SourceSageDB.db
> 2015-01-12 19:09:44.273 SourceSage[6842:737878] *** Terminating app due to uncaught exception
> 'NSInvalidArgumentException', reason: '*** -[__NSCFConstantString
> stringByAppendingString:]: nil argument'
> *** First throw call stack:
> (0x2ce265f7 0x3a560c77 0x2ce2653d 0x2da749b3 0x1224b9 0xd2465 0x85569 0x302ff197 0x302ff139 0x302e9d1d 0x302feb69 0x302fe843
> 0x302f8151 0x302ce8c5 0x30542373 0x302cd307 0x2cdecfd7 0x2cdec3eb
> 0x2cdeaa69 0x2cd37b31 0x2cd37943 0x340f0051 0x3032d6f1 0x118fd9
> 0x3aafcaaf)
> libc++abi.dylib: terminating with uncaught exception of type NSException
> (lldb)
The log exactly says NSString* po = getUser.ofUser;
日志准确显示为NSString* po = getUser.ofUser;
returns null
or nil
value. 返回null
或nil
值。
You're passing this nil
argument to the method [[QuoteMessageController SharedInstance] SendChatMessageTo: withContent: toUserId: andOFId:po andVerifyKey:];.
您正在将此nil
参数传递给方法[[QuoteMessageController SharedInstance] SendChatMessageTo: withContent: toUserId: andOFId:po andVerifyKey:];.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.