重复打印出来

时间:2017-06-27 05:07:16

标签: ios objective-c

我有评论包含评论数组的对象,我正在尝试在控制台上打印输出( po )值,右手侧。

但每次都会为同一个对象打印两次。我只是想知道出了什么问题?

的AppDelegate

@interface AppDelegate ()
@property (strong, nonatomic) YLPClient *client;


@end

@implementation AppDelegate

+ (YLPClient *)sharedClient {
    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    return appDelegate.client;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [YLPClient authorizeWithAppId:@"VaD3dX7rhyfS_tVJKOu8pp" secret:@"YTCQCG3nCErq54oeXSJbYd5kEW9OrTKcEpG1e3BKBixNTS7US3LgDdg8QAW3tUXX" completionHandler:^(YLPClient *client, NSError *error) {
        self.client = client;
        if (!client) {
            NSLog(@"Authentication failed: %@", error);
        }
    }];
    return YES
}

ViewController.m

- (void)viewDidLoad {
    [super viewDidLoad];
    [[AppDelegate sharedClient] reviewsForBusinessWithId:@"fadis-meyerland-mediterranean-grill-houston" completionHandler:^
         (YLPBusinessReviews *reviews, NSError* error) {
             dispatch_async(dispatch_get_main_queue(), ^{
             });
    }];
}

enter image description here

0 个答案:

没有答案
相关问题