2014-09-21 31 views
-1

我从Imgur API检索数组,但我不知道它包含什么,我怎么能看到数组的组成,因为API没有指定组合。如何知道Objective-C中的数组组成?

[IMGGalleryRequest hotGalleryPage:0 success:^(NSArray *objects) { 

    self.wallObjectsArray = nil; 
    self.wallObjectsArray = [[NSArray alloc] initWithArray:objects]; 

    [self loadWallViews]; 

} failure:^(NSError *error) { 

    //Remove the activity indicator 
    [self.activityIndicator stopAnimating]; 
    [self.activityIndicator removeFromSuperview]; 

    //Show the error 
    NSString *errorString = [[error userInfo] objectForKey:@"error"]; 
    [self showErrorView:errorString]; 
}]; 
    } 
+0

它包含里面的东西。要了解一下,请查看(或查阅您正在使用的API的文档)。 – 2014-09-21 13:11:03

回答

0

如果你只是想知道什么样的对象包含,怎么样:

for(id anObject in wallObjectsArray) { 
    NSLog(@"Object has class %@ and description %@", [anObject class], anObject); 
} 

没有帮助,如果你还需要更多的语义,但它是一个开始。

相关问题