我试图在支持iOS5 ARC的应用中使用Hackbook示例应用。我正在使用Facebook的示例Hackbook应用程序中的APIResultsViewController。我的应用程序启用了ARC,因此我确保我在Hackbook中使用的文件已将-fno-objc-arc
添加为编译器标志。我现在遇到的错误是Use of undeclared identifer 'jsonWriter'; did you mean SBJSonWriter'?
和Unknown receiver 'jsonWriter'
我有来自Facebook API的src文件夹中的SBJSON。我能够在我的应用程序中使用Facebook Api。然后我想使用Hackbook示例中的功能和代码。在移动代码之后弹出那些错误。谢谢你的帮助
这里是发生错误的代码
* Graph API: Check in a user to the location selected in the previous view.
*/
- (void)apiGraphUserCheckins:(NSUInteger)index {
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
SBJSON *jsonWriter = [[SBJSON new] autorelease];
NSDictionary *coordinates = [NSDictionary dictionaryWithObjectsAndKeys:
[[[myData objectAtIndex:index] objectForKey:@"location"] objectForKey:@"latitude"],@"latitude",
[[[myData objectAtIndex:index] objectForKey:@"location"] objectForKey:@"longitude"],@"longitude",
nil];
NSString *coordinatesStr = [jsonWriter stringWithObject:coordinates];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[[myData objectAtIndex:index] objectForKey:@"id"], @"place",
coordinatesStr, @"coordinates",
@"", @"message",
nil];
[[delegate facebook] requestWithGraphPath:@"me/checkins"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
}
感谢您的帮助