I'm trying to just add objects to a mutable array, but they are NOT inserted. I do not get errors or anything else, and I can not understand what is happening.
In my main delegate file, I split the array into 4 separate lines.
NSArray *split=[currentParsedCharacterData componentsSeparatedByString:@"|"];
NSLog([split objectAtIndex:3]);
NSString *date=[split objectAtIndex:0];
NSString *venue=[split objectAtIndex:1];
NSString *event=[split objectAtIndex:2];
NSString *city=[split objectAtIndex:3];
I traced string values, and they definitely exist.
Next I will try to add these string values ββto mutable arrays.
[self.promoTabOptionEvents.dates addObject:date]
[self.promoTabOptionEvents.venues addObject:venue]
[self.promoTabOptionEvents.event addObject:event]
[self.promoTabOptionEvents.city addObject:city]
When I check arrays in the debugger, they are empty. What am I doing wrong?
The promoTabOptionEvents class is as follows
import
@interface PromoTabOptionEvents : UIViewController {
NSString *event_headline;
NSMutableArray *dates;
NSMutableArray *venues;
NSMutableArray *event;
NSMutableArray *city;
}
@property(nonatomic,retain)NSString *event_headline;
@property(nonatomic,retain)NSMutableArray *dates;
@property(nonatomic,retain)NSMutableArray *venues;
@property(nonatomic,retain)NSMutableArray *event;
@property(nonatomic,retain)NSMutableArray *city;
-(void)applyLabels;
-(id)initWithTabBar;
@end
#import "PromoTabOptionEvents.h"
@implementation PromoTabOptionEvents
@synthesize event_headline;
@synthesize dates;
@synthesize venues;
@synthesize event;
@synthesize city;
-(id) initWithTabBar {
if ([self init]) {
self.tabBarItem.image = [UIImage imageNamed:@"events.png"];
self.navigationItem.title=@"Events";
CGRect bgframe;
bgframe.size.width=320; bgframe.size.height=460;
bgframe.origin.x=0; bgframe.origin.y=0;
UIImage* bgimage = [UIImage imageNamed:@"eventsbig.png"];
UIImageView *imagebgview = [[UIImageView alloc] initWithImage: bgimage];
imagebgview.frame=bgframe;
imagebgview.contentMode=UIViewContentModeScaleAspectFit;
self.view.backgroundColor=[UIColor whiteColor];
[self.view addSubview:imagebgview];
}
return self;
}
source
share