When I run the following code, I get the data from the Parse.com database, but when I try to print out the array that I try to store this data in, it gives off a null value. Help!
PFQuery *query = [PFQuery queryWithClassName:@"Resolution"];
[query whereKey:@"event" equalTo:event_name_label.text];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
for (PFObject *object in objects) {
[resolution_names addObject:(NSString*)[object objectForKey:@"resolution_name"]];
NSLog(@"%@", [object objectForKey:@"resolution_name"]);
}
NSLog(@"%@", resolution_names);
} else {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
I have properly declared (I think) the NSMutableArray resolution_names, but it returns null upon logging it.
Here is my header file:
#import <UIKit/UIKit.h>
@interface MenuViewController : UIViewController {
IBOutlet UILabel *event_name_label;
NSString *event_id;
NSString *event_name;
NSMutableArray *resolution_names;
NSMutableArray *resolution_pro_speakers;
NSMutableArray *resolution_con_speakers;
NSMutableArray *resolution_results;
NSMutableArray *billtrackertablevalues;
}
@property (nonatomic, retain) IBOutlet UILabel *event_name_label;
@property (nonatomic) NSString *event_id;
@property (nonatomic) NSString *event_name;
@property (nonatomic) NSMutableArray *resolution_names;
@property (nonatomic) NSMutableArray *resolution_pro_speakers;
@property (nonatomic) NSMutableArray *resolution_con_speakers;
@property (nonatomic) NSMutableArray *resolution_results;
@property (nonatomic) NSMutableArray *billtrackertablevalues;
@end
Once again, I am able to see the values of [object objectForKey:@"resolution_name"] in the console, but when I try to output the values of the NSMutableArray resolution_names, it just says "(null)" on the console.