Welcome to the iMore Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 1 of 1
  1. Thread AuthorThread Author   #1  
    bilalwahla-ios-forum's Avatar
    iPhone Nanite

    3 Posts

    Default EXC_BAD_ACCESS in viewDidLoad of FlipsideViewController

    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 {

    Many thanks...
    Last edited by bilalwahla-ios-forum; 11-22-2010 at 08:38 PM.

Posting Permissions