我使用 SOAP 从网站获取时间,当执行以下源代码时,它会引发问题。我猜下面源代码的第 4 行有问题,但我不知道如何解决,请帮助。谢谢。
源代码:
-(void) parse:(NSXMLParser *)parser didEndElement:(NSString *) elementName namespaceURI:(NSString *)namespceURI qualifiedName:(NSString *)qName {
if ([elementname isEqualToString:@"getOffesetUTCTimeResult"])
{
greeting.text = [[[NSString init] strinWithFormat:@"The local time is:", nameInput.text] stringByAppending:soapResults];
[soapResults release];
soapResults = nil;
}
}
引发错误:
*** Termination app due to uncaught exception 'NSInvalidArgumentException', reason: '** +[NSString <0x267fd8> init]: cnnot init a class object.'
*** First throw call stack:
...
terminate called throwing an exception