简体   繁体   English

由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“ ***-[__ NSCFConstantString stringByAppendingString:]:无参数”

[英]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. 返回nullnil值。

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.

相关问题 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“数据参数为nil” - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil' 得到“ ***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[__ NSCFNumber compare:]:nil参数'” - getting “*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber compare:]: nil argument'” **由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'应用程序试图在目标上显示nil模态视图控制器 - ** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“ *** setObjectForKey:键不能为零” - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: key cannot be nil' 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'UICollectionView必须使用非nil布局参数初始化 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'UICollectionView must be initialized with a non-nil layout parameter Swift:由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“实体名称不能为零。” - Swift : Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Entity name must not be nil.' 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“应用程序试图在目标上显示nil模态视图控制器 - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“ *** setObjectForKey:对象不能为nil(键:索引)” - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: index)' 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'+ entityForName:nil不是合法的NSManagedObjectContext - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+entityForName: nil is not a legal NSManagedObjectContext 由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“-[SWRevealViewController manifestToggel:] - Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[SWRevealViewController revealToggel:]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM