1. bilalwahla-ios-forum's Avatar
    Hi all,

    I'm new to objective-c and iOS. It would be great help if someone could please guide. I'm trying to load some data from a plist file and display it on the flip side view (utility template application). But for some reason application terminates at the end of viewDidLoad method. Below is what I'm doing in this method.

    [super viewDidLoad];
    self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];

    NSString *thePath = [[NSBundle mainBundle] pathForResource:@"SavedData" ofType:@"plist"];

    NSMutableDictionary *tempRootDictionary;
    NSMutableArray *tempMutableArray;
    if (thePath && (tempRootDictionary = [NSMutableDictionary dictionaryWithContentsOfFile:thePath])) {
    NSArray *keys = [tempRootDictionary allKeys];
    int keysCount = [keys count];
    tempMutableArray = [NSMutableArray arrayWithCapacity:keysCount];
    for (int i=0; i<keysCount; i++) {
    NSDictionary *dictionary = [tempRootDictionary objectForKey:[keys objectAtIndex:i]];
    MyModelObject *aModelObject = [[MyModelObject alloc] init];
    [aModelObject setName:[dictionary objectForKey:@"name"]];
    [aModelObject setContext:[dictionary objectForKey:@"context"]];
    [aModelObject setUsername:[dictionary objectForKey:@"username"]];
    [aModelObject setPassword:[dictionary objectForKey:@"password"]];
    [tempMutableArray addObject:aModelObject];
    [aModelObject release];
    [dictionary release];
    }
    } else {
    return;
    }

    Many thanks...
    Last edited by bilalwahla-ios-forum; 11-22-2010 at 09:38 PM.
    11-22-2010 09:36 PM
LINK TO POST COPIED TO CLIPBOARD