故障汇编(iPhone开发)

问题描述:

我编译我的应用程序,我有这个错误 - 命令/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang失败,退出代码1故障汇编(iPhone开发)

再加上我想通知什么他会发布给用户。我想这 -

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]; 

但它给我 - 错误:李毅华,结果未使用的和错误:发送“的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) 

返回(* sometext),它是类型(的NSString) 但格式改性剂%@需要一个指向对象( “ID”这基本上是指向一个NSObject)

第二,如果你使用的格式,您甲肾上腺素ED功能/ selctor到解析这种格式(NSLog() or +[NSString stringWithFormat: (NSString*)format]或c-风格sprintf()等)

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