小编spa*_*tra的帖子

在Racket中列出字符串转换

如何将列表转换为DrRacket中的字符串?例如,如何将'(红黄蓝绿)转换为"红黄蓝绿"?我尝试使用list-> string但这似乎只适用于字符.

string scheme list racket

5
推荐指数
2
解决办法
1万
查看次数

为什么isEqualToString对NSString不起作用?

我正在尝试在XCode中编写iPhone应用程序的登录过程.问题在于下面的NSString serverOutput.当我使用printf(serverOutput.UTF8String)打印它时; 它向控制台打印"是".但是,当我将serverOutput与"是"进行比较时,它不起作用.任何帮助,将不胜感激.这是我的代码:

- (IBAction) loginButton: (id) sender
{
    // TODO: spawn a login thread

    indicator.hidden = FALSE;
    [indicator startAnimating];
    NSString *post =[NSString stringWithFormat:@"username=%@&password=%@",userName.text, password.text];

    NSString *hostStr = @"http://10.243.1.184/connectDB.php?";
    hostStr = [hostStr stringByAppendingString:post];
    NSData *dataURL =  [NSData dataWithContentsOfURL: [ NSURL URLWithString: hostStr ]];
    NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding];
    printf(serverOutput.UTF8String);


    if([serverOutput isEqualToString:@"Yes"]){


        UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Congrats" message:@"You are authorized"
        delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];

        [alertsuccess show];
        [alertsuccess release];


    }
    else {
        UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Error" …
Run Code Online (Sandbox Code Playgroud)

xcode compare objective-c nsstring

1
推荐指数
1
解决办法
2260
查看次数

标签 统计

compare ×1

list ×1

nsstring ×1

objective-c ×1

racket ×1

scheme ×1

string ×1

xcode ×1