编译中的问题(iPhone开发)

编译中的问题(iPhone开发),iphone,objective-c,xcode,Iphone,Objective C,Xcode,我编译了我的应用程序,出现了此错误-Command/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang失败,退出代码为1 另外,我想通知用户他将要发布的内容。我试过这个- NSString *someText = textForSharing; UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Confirm" message:(

我编译了我的应用程序,出现了此错误-Command/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang失败,退出代码为1

另外,我想通知用户他将要发布的内容。我试过这个-

NSString *someText = textForSharing;
    UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Confirm" message:(@"Are you sure you want to post %@ on your facebook wall?", *someText) delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
但它给出了-error:expression result unused和error:Sending'NSString'到不兼容类型'NSString*'的参数


我该怎么办?提前谢谢

这种语法是从哪里来的

(@"Are you sure you want to post %@ on your facebook wall?", *someText)
试一试

[NSString stringWithFormat:@"Are you sure you want to post %@ on your facebook wall?", someText];
第一,表达

(@"Are you sure you want to post %@ on your facebook wall?", *someText)
返回类型为(NSString)的(*sometext) 但格式修饰符%@需要指向对象的指针(“id”基本上是指向对象的指针)


其次,如果使用format,则需要函数/selctor来解析此格式(
NSLog()或+[NSString stringWithFormat:(NSString*)格式]
或c-style
sprintf()
,等等)

使用stringWithFormat,这将解决不兼容类型的“NSString*”错误