以下のコードでいくつかのエラーが表示されます。エラーは '宣言されていない識別子' SBJSON 'と'不明な受信者 'jsonParser'を使用しています.SBJsonParser 'を意味しましたか?iOSプロジェクトで不明な受信者 'jsonParser'エラーが発生しました
私のプロジェクトにはJSONライブラリがあります。 Facebook Graph APIとGoogle Placesと連携しています。何らかの理由で、下記のコード(Facebook API用)でもJSONファイルが見つかりません。どんな考え?私はそれらをプロジェクトに間違ってドラッグしたりドロップしたりしているのだろうかと思います。
ありがとうございました。
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[self hideActivityIndicator];
NSString* responseString = [[[NSString alloc] initWithData:receivedData
encoding:NSUTF8StringEncoding]
autorelease];
NSLog(@"Response from photo upload: %@",responseString);
[self clearConnection];
// Check the photo upload server completes successfully
if ([responseString rangeOfString:@"ERROR:"].location == NSNotFound) {
SBJSON *jsonParser = [[SBJSON new] autorelease];
id result = [jsonParser objectWithString:responseString];
// Look for expected parameter back
if ([result objectForKey:@"image_name"]) {
productImageData = [result copy];
// Now that we have successfully uploaded the photo
// we will make the Graph API call to send our Wishlist
// information.
[self apiGraphAddToWishlist];
} else {
[self showAlertErrorMessage:@"Could not upload the photo." ];
}
} else {
[self showAlertErrorMessage:@"Could not upload the photo." ];
}
}
をインポートしましたが
また、あなたが参照しているファイルがSBJSON.hをインポートしていることを確認してください? – Matthias
ヘッダ#import SBJSON.hは、FBConnect.hファイルを介してインポートされます。それは次のインポートのディレクティブを持っています。#include "Facebook.h" の#include "FBDialog.h" の#include "FBLoginDialog.h" の#include "FBRequest.h" の#include "SBJSON.h" – hanumanDev