2011-12-28 5 views
0

私は私のアプリをコンパイルし、私はこれは、コマンド/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clangが終了コード1トラブル(iPhoneのDev)

で失敗しましたプラス私が欲しいエラー - 持っています彼が何を投稿するかをユーザーに通知する。私はthis-

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

を試みたが、それはME-エラーを与える:Experession結果を未使用とエラー:「NSStringの*」

私は何をすべき互換性のない型のパラメータに「NSStringの」を送信しますか?前もって感謝します!

答えて

1

どこから来るのですか?

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

タイプ(NSStringの) であるが、フォーマット修飾%@をオブジェクトへのポインタを必要と

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

まず、式

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

戻る(* sometext)(としてみてください"id"は基本的にNSObjectへのポインタです)

第2に、フォーマットを使用すると、互換性のない型 'のNSString *' エラーを解決します解析にエド機能/ selctorこの形式(NSLog() or +[NSString stringWithFormat: (NSString*)format]またはc-スタイルsprintf()、など)

0

使用stringWithFormat、。

関連する問題