如何修复xcode警告"表达结果未使用"

C.J*_*hns 4 iphone xcode warnings ios

我正在使用我的应用程序进行注册过程,其中用户输入我检查我的数据库的数字..无论如何长话短说我将代码传递到我的NSString*startURL 有一个警告我无法摆脱,它说

"表达结果未使用"

你有没有经历过这样的事情,如果有的话我该如何解决?

   -(void)startRegConnect:(NSString *)tempRegCode{

        //tempRegCode = S.checkString;
        NSLog(@"tempRegCode from RegConnection =%@",tempRegCode);


        NSString *code = [[NSString alloc] initWithString:tempRegCode];
        //urlstart string
        NSString *startURL = (@"http://188.162.17.44:8777/ICService/?RegCode=%@",code); //warning here

        NSURL *url = [NSURL URLWithString:startURL];

        //create a request object with that url
        NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:30];

        //clear out the exisiting connection if there is on
        if (connectionInProgress) {
            [connectionInProgress cancel];
            [connectionInProgress release];
        }

        //Instantiate the object to hold all incoming data
        [cookieData release];
        cookieData = [[NSMutableData alloc]init];

        //create and initiate the connection - non-blocking
        connectionInProgress = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];

    }
Run Code Online (Sandbox Code Playgroud)

jtb*_*des 12

你不能这样做(@"http://188.162.17.44:8777/ICService/?RegCode=%@",code).使用[NSString stringWithFormat:@"http://188.162.17.44:8777/ICService/?RegCode=%@", tempRegCode].