Question

I'm creating a basic music app - the albums of a band display in a UICollectionView first, then when I click on an album, I get pushed to the detail view, which displays information about the selected album, along with the album tracklist. The point of the app, is to be able to click on a tracklist cell, and the song will play.

I have these massive Arrays that contain the full tracklist of all the albums, not cool, too big.

I was told that I could use a Plist file. However, I wonder how I can put all the information in one plist file, since I have several albums, and therefore several tracklists. Should I create one plist file listing all my albums? Then where should I insert the tracklist next?

Can you point me to a solution?

Here's a screenshot of my storyboard:

screenshot

Click here to view screenshot full screen.

I am a beginner, and would like to optimize my code. I can't get the song in the cell to play yet.

CollectionViewController.h:

#import <UIKit/UIKit.h>

@interface CollectionViewController : UICollectionViewController

@property (strong, nonatomic) NSArray *albumImages;
@property (strong,nonatomic) NSArray *albumDescriptions;

@end

CollectionViewController.m:

#import "CollectionViewController.h"
#import "Cell.h"
#import "ImageDetailViewController.h"

@interface CollectionViewController ()

@end

@implementation CollectionViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.albumImages = @[@"1998_Yellow.png",@"1998_WoM",@"2000_PoTY",@"2001_SFA",@"2003_MFZB",@"2004_WoMFZB",@"2006_BttW",@"2008_NtnA",@"2008_Phoenix",@"2009_PantyRaid",@"2011_GetNice",@"2013_CyF"];
    self. albumDescriptions = @[@"Yellow [1998]",@"Waste of Mind [1998]",@"Playmate of the Year [2000]",@"Stupid Fat Americans - EP [2001]",@"MFZB [2003]",@"Waste of MFZB [2004]",@"Broadcast to the World [2006]",@"Not the New Album - EP [2008]",@"Phoenix [2008]",@"Panty Raid [2009]",@"Get Nice! [2011]",@"Call Your Friends [2013]" ];

}



- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section

{
    return self.albumImages.count;
}



- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    Cell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MY_CELL" forIndexPath:indexPath];
    UIImage *albumImage = [[UIImage alloc] init];
    albumImage = [UIImage imageNamed:[self.albumImages objectAtIndex:indexPath.row]];
    cell.imageView.image = albumImage;
    return cell;
    NSLog(@"Cellule cliquée");
}



#pragma mark - Prepare for Segue
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    UICollectionViewCell *cell = (UICollectionViewCell *)sender;
    NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
    NSLog(@"Segue versDetails");

    ImageDetailViewController *imageDetailViewController = (ImageDetailViewController *)segue.destinationViewController;
    imageDetailViewController.albumImage = [UIImage imageNamed:[self.albumImages objectAtIndex:indexPath.row]];
    imageDetailViewController.albumLabelText = [self. albumDescriptions objectAtIndex:indexPath.row];
}


- (void)viewWillAppear:(BOOL)animated
{

    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void)viewDidDisappear: (BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewDidDisappear:animated];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

ImageDetailViewController.h:

@interface ImageDetailViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>

@property (strong, nonatomic) IBOutlet UIImageView *albumImageView;
@property (strong, nonatomic) IBOutlet UILabel *albumDetailLabel;
@property (strong, nonatomic) UIImage *albumImage;
@property (strong, nonatomic) NSString *albumLabelText;

@property (strong,nonatomic) NSArray *tracklist_Y;
@property (strong,nonatomic) NSArray *tracklist_WoM;
@property (strong,nonatomic) NSArray *tracklist_PotY;
@property (strong,nonatomic) NSArray *tracklist_SFA;
@property (strong,nonatomic) NSArray *tracklist_MFZB;
@property (strong,nonatomic) NSArray *tracklist_WoMFZB;
@property (strong,nonatomic) NSArray *tracklist_BttW;
@property (strong,nonatomic) NSArray *tracklist_NtnA;
@property (strong,nonatomic) NSArray *tracklist_Ph;
@property (strong,nonatomic) NSArray *tracklist_PR;
@property (strong,nonatomic) NSArray *tracklist_GN;
@property (strong,nonatomic) NSArray *tracklist_CyF;


@end

imageDetailViewController.m:

#import "ImageDetailViewController.h"
#import "animationY.h"

@interface ImageDetailViewController ()

@end

@implementation ImageDetailViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 10;
    //return [self.tracklist_Y count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    //Liste des chansons (Tracklist)


    //http://blog.safaribooksonline.com/2013/02/26/objective-c-how-to-populate-data-in-uitableviewcontroller/

    self.tracklist_Y = [[NSArray alloc]initWithObjects:@"1. Check",@"2. All I Need",@"3. Swing",@"4. Walk Away",@"5. Bootylicious Vinyl",@"6. Hate",@"7. Mindtrip",@"8. Chrome",@"9. Jag Off",@"10. Song 10",nil];
    self.tracklist_WoM = [[NSArray alloc]initWithObjects:@"1. Check",@"2. Get Back",@"3. The Real Me",@"4. Someday",@"5. Waste of Mind",@"6. Feel This Way",@"7. Walk Away",@"8. Big Shot",@"9. Swing",@"10. Jag Off",@"11. Time",@"12. Move On",@"13. Flay Daze",@"14. Bootylicious Vinyl",nil];
    self.tracklist_PotY = [[NSArray alloc]initWithObjects:@"1. I Am",@"2. Playmate of the Year",@"3. Now or Never",@"4. Wasted",@"5. I'm Money",@"6. Go",@"7. What's Goin' On?",@"8. Subtract You",@"9. The Hell that is my Life",@"10. E Generation",@"11. Livin' Libido Loco",@"12. In My Room",nil];
    self.tracklist_SFA = [[NSArray alloc]initWithObjects:@"1. Wasted",@"2. Chrome [Demo Version]",@"3. Swing [Demo Version]",@"4. Deck the Halls (I Hate Christmas) W/Intro",@"5. Jag Off [Live]",@"6. Someday [Live]",@"7. Get Back [Live]",nil];
    self.tracklist_MFZB = [[NSArray alloc]initWithObjects:@"1. Rescue Me",@"2. Over the Edge",@"3. Strength",@"4. Hello Tomorrow",@"5. The Set-Up",@"6. Blur",@"7. House is Not my Home",@"8. Into You",@"9. Alone",@"10. Expectations",@"11. Falling Apart",@"12. Let it Ride",@"13. Type A",@"14. Runaway",@"15. Dear You (Far Away)",@"16. The Fear",@"17. Surrender [*]",@"18. Good Things [*]",@"19. Dissatisfied [*]",nil];
    self.tracklist_WoMFZB = [[NSArray alloc]initWithObjects:@"1. Are You For Real?",@"2. Let Me Go",@"3. One Less Headache]",@"4. Burn the School Down",@"5. Lightning Rod",@"6. Blindside",@"7. Veils and Visions",@"8. One Shot",@"9. Timing is Everything",@"10. Wannabe",nil];
    self.tracklist_BttW = [[NSArray alloc]initWithObjects:@"1. Broadcast to the World",@"2. Rated \"U\" for Ugly",@"3. Anthem",@"4. Enemy",@"5. Back to Normal",@"6. Postcards from Hell",@"7. Karma Flavored Whisky",@"8. Here's to You",@"9. Wake me Up",@"10. Lobotomy for Dummies",@"11. The Walking Dead",@"12. Your New Boyfriend Wears Girl Pants",@"13. Riot Girl [*]",@"14. Down in Flames [*]",@"15. Get on the Bus [*]",@"16. Hit it Again [*]",nil];
    self.tracklist_NtnA = [[NSArray alloc]initWithObjects:@"1. Mental Health",@"2. Photographs",@"3. Politics",@"4. The Art of Breaking Up",@"5. We're Not a Cover Band, We're a Tribute Band",nil];
    self.tracklist_Ph = [[NSArray alloc]initWithObjects:@"1. HMP",@"2. Hell Yeah!",@"3. Just the Tip",@"4. Mental Health",@"5. The Juggernauts",@"6. Death by Disco",@"7. Be Careful What You Wish For",@"8. Morse Code for Suckers",@"9. Ignite",@"10. Mike Dexter is a God, Mike Dexter is a Role Model, Mike Dexter is an A**hole",@"11. The Junkie and the Halo",@"12. Brixton",@"13. Hit the Ground",@"14. Two Wrongs don't make a Right, but Three Rights make a Left",@"15. All for None and None for All",@"16. Sorry, but Your Friends are Hot",@"17. The Art of Breaking Up [*]",@"18. We're Not a Cover Band, We're a Tribute Band [*]",nil];
    self.tracklist_PR = [[NSArray alloc]initWithObjects:@"1. Survivor",@"2. Girls Just Want to Have Fun",@"3. Underneath it All",@"4. Trouble",@"5. London Bridge",@"6. Beautiful",@"7. Girlfriend",@"8. The Sweet Escape",@"9. Jenny from the Block",@"10. Rehab",@"11. Spice Up Your Life",@"12. Oops!... I Did it Again",@"13. Get the Party Started",@"14. Mickey",@"15. All I Want for Christmas is You [*]",@"16. Who Let the Dogs Out [*]",nil];
    self.tracklist_GN = [[NSArray alloc]initWithObjects:@"1. Blackout",@"2. Nothing to Lose",@"3. She Don't Wanna Rock",@"4. Ricky Bobby",@"5. Get Nice!",@"6. The Joke's on You",@"7. Nudist Priest",@"8. Galileo Was Wrong",@"9. Truck Stops and Tail Lights",@"10. I'm Definitely Not Gonna Miss You",@"11. Too Bored to Bleed",@"12. Kiss your Ass Goodbye",@"13. This is Gonna Hurt You Way More than it's Gonna Hurt Me",@"14. Demon Days",@"15. Light Up the Sky [*]",@"16. A Freak Gasoline Fight Accident [*]",nil];
    self.tracklist_CyF = [[NSArray alloc]initWithObjects:@"1. Sirens",@"2. I'm Just Here for the Free Beer",@"3. With Friends Like These, Who Needs Herpes?",@"4. Call Your Friends",@"5. Murder on the Airwaves",@"6. Public Enemy Number One",@"7. Born to Lose",@"8. Stick Em Up Kid!",@"9. Automatic",@"10. Nerd Armor",@"11. Panic in the Streets",@"12. Don't Believe the Hype",@"13. Until the Sun Comes Up",@"14. Last Call",@"15. Sex, Lies & Audiotape [*]",@"16. Battle of the Bullshit [*]",@"17. Ready Steady Go [*]",nil];


    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TrackCell"];

    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TrackCell"];
    }



    // Vérification de quel album a été cliqué;
    // Il semble qu'il n'y ait pas moyen d'utiliser un Switch avec un NSString, selon StackOverflow : http://goo.gl/dpylqF


    if ([_albumDetailLabel.text isEqualToString:@"Yellow [1998]"]) {
        animationY * jouerAnimationY = [[animationY alloc]initWithFrame:CGRectMake(85, -20, 600, 600) prefixNom:@"yellowAnim" nbImages:120];
        [self.view addSubview: jouerAnimationY ];
        cell.textLabel.text = [self.tracklist_Y objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Yellow";
        return cell;*/        
    } else if ([_albumDetailLabel.text isEqualToString:@"Waste of Mind [1998]"]) {
        cell.textLabel.text = [self.tracklist_WoM objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Waste of Mind";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Playmate of the Year [2000]"]) {
        cell.textLabel.text = [self.tracklist_PotY objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Playmate of the Year";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Stupid Fat Americans - EP [2001]"]) {
        cell.textLabel.text = [self.tracklist_SFA objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Stupid Fat Americans";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"MFZB [2003]"]) {
        cell.textLabel.text = [self.tracklist_MFZB objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"MFZB";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Waste of MFZB [2004]"]) {
        cell.textLabel.text = [self.tracklist_WoMFZB objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Waste of MFZB";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Broadcast to the World [2006]"]) {
        cell.textLabel.text = [self.tracklist_BttW objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Broadcast to the World";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Not the New Album - EP [2008]"]) {
        cell.textLabel.text = [self.tracklist_NtnA objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Not the New Album";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Phoenix [2008]"]) {
        cell.textLabel.text = [self.tracklist_Ph objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Phoenix";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Panty Raid [2009]"]) {
        cell.textLabel.text = [self.tracklist_PR objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Panty Raid";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Get Nice! [2011]"]) {
        cell.textLabel.text = [self.tracklist_GN objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Get Nice!";
        return cell;*/
    } else if ([_albumDetailLabel.text isEqualToString:@"Call Your Friends [2013]"]) {
        cell.textLabel.text = [self.tracklist_CyF objectAtIndex:indexPath.row];
        cell.textLabel.textColor=[UIColor whiteColor];
        return cell;
        /*cell.textLabel.text = @"Call Your Friends";
        return cell;*/
    }

}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.navigationController.navigationBar.hidden = NO;

    self.albumImageView.image = self.albumImage;
    self.albumDetailLabel.text = self.albumLabelText;

}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
Was it helpful?

Solution

I used to use the view controller as my data model also.

Your Plist should be structured like so.

  • root (Array)
    • Album one (NSDictionary)
      • Album Image (NSString)
      • Album Label (NSString)
      • Album Tracklist (NSString)
    • Album two (NSDictionary)
      • Album Image (NSString)
      • Album Label (NSString)
      • Album Tracklist (NSString)
    • Album three (NSDictionary)
      • Album Image (NSString)
      • Album Label (NSString)
      • Album Tracklist (NSString)
    • Album four (NSDictionary)
      • Album Image (NSString)
      • Album Label (NSString)
      • Album Tracklist (NSString)

The Code:

CollectionViewController.h : Empty it.

CollectionViewController.m:

    #import "CollectionViewController.h"
#import "Cell.h"
#import "ImageDetailViewController.h"

@interface CollectionViewController ()
@property (nonatomic, strong) NSArray *albums;
@end

@implementation CollectionViewController

- (void)viewDidLoad
{
    [super viewDidLoad];


    //You dont want this.
    /*self.albumImages = @[@"1998_Yellow.png",@"1998_WoM",@"2000_PoTY",@"2001_SFA",@"2003_MFZB",@"2004_WoMFZB",@"2006_BttW",@"2008_NtnA",@"2008_Phoenix",@"2009_PantyRaid",@"2011_GetNice",@"2013_CyF"];
    self. albumDescriptions = @[@"Yellow [1998]",@"Waste of Mind [1998]",@"Playmate of the Year [2000]",@"Stupid Fat Americans - EP [2001]",@"MFZB [2003]",@"Waste of MFZB [2004]",@"Broadcast to the World [2006]",@"Not the New Album - EP [2008]",@"Phoenix [2008]",@"Panty Raid [2009]",@"Get Nice! [2011]",@"Call Your Friends [2013]" ];*/


    //Do this if you are using a plist

    //Makes everything thread happy (maximal responsiveness)
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        NSError *error;
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //Get path of application
        NSString *documentsDirectory = [paths objectAtIndex:0]; //Get documents path
        NSString *path = [documentsDirectory stringByAppendingPathComponent:@"data.plist"]; //Get path to dictionary

        NSFileManager *fileManager = [NSFileManager defaultManager];

        if (![fileManager fileExistsAtPath: path]) //Check if file exists
        {
            NSString *bundle = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"plist"]; //Locate file in bundle
            [fileManager copyItemAtPath:bundle toPath: path error:&error]; //Copy file over
        }

        self.albums = [[NSArray alloc] initWithContentsOfFile: path]; //Initalize dictionary from plist
        dispatch_async(dispatch_get_main_queue(), ^{
            [self.collectionView reloadData]; //Reload your data
        });
    });
}



- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section

{
    return [self.albums count];
}



- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    Cell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"MY_CELL" forIndexPath:indexPath];
    UIImage *albumImage = [[UIImage alloc] init];
    albumImage = [UIImage imageNamed:[[self.albums objectAtIndex:indexPath.row] objectForKey:@"Album Image"]];
    cell.imageView.image = albumImage;
    return cell;
    NSLog(@"Cellule cliquée");
}



#pragma mark - Prepare for Segue
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    UICollectionViewCell *cell = (UICollectionViewCell *)sender;
    NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
    NSLog(@"Segue versDetails");

    ImageDetailViewController *imageDetailViewController = (ImageDetailViewController *)segue.destinationViewController;
    imageDetailViewController.album = [self.albums objectAtIndex:indexPath.row];
}


- (void)viewWillAppear:(BOOL)animated
{

    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void)viewDidDisappear: (BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewDidDisappear:animated];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

ImageDetailViewController.h:

@interface ImageDetailViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>

@property (strong, nonatomic) IBOutlet UIImageView *albumImageView;
@property (strong, nonatomic) IBOutlet UILabel *albumDetailLabel;
/*@property (strong, nonatomic) UIImage *albumImage;
@property (strong, nonatomic) NSString *albumLabelText;*/

@property (nonatomic, strong) NSDictionary *album;

/*@property (strong,nonatomic) NSArray *tracklist_Y;
@property (strong,nonatomic) NSArray *tracklist_WoM;
@property (strong,nonatomic) NSArray *tracklist_PotY;
@property (strong,nonatomic) NSArray *tracklist_SFA;
@property (strong,nonatomic) NSArray *tracklist_MFZB;
@property (strong,nonatomic) NSArray *tracklist_WoMFZB;
@property (strong,nonatomic) NSArray *tracklist_BttW;
@property (strong,nonatomic) NSArray *tracklist_NtnA;
@property (strong,nonatomic) NSArray *tracklist_Ph;
@property (strong,nonatomic) NSArray *tracklist_PR;
@property (strong,nonatomic) NSArray *tracklist_GN;
@property (strong,nonatomic) NSArray *tracklist_CyF;*/


@end

ImageDetailViewController.m

#import "ImageDetailViewController.h"

@interface ImageDetailViewController ()
@end

@implementation ImageDetailViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}


-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [[self.album objectForKey:@"Album Tracklist"] count];
    //return [self.tracklist_Y count];
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    //Liste des chansons (Tracklist)


    //http://blog.safaribooksonline.com/2013/02/26/objective-c-how-to-populate-data-in-uitableviewcontroller/


    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TrackCell"];

    if(cell == nil){
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TrackCell"];
    }

    cell.textLabel.text = [[self.album objectForKey:@"Album Tracklist"] objectAtIndex:indexPath.row];
    cell.textLabel.textColor = [UIColor whiteColor];
    return cell;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.navigationController.navigationBar.hidden = NO;
    self.albumDetailLabel = [self.album objectForKey:@"Album Label"];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

So basically here, you have an array of your albums, and you are extracting the image, label, and track list when you do the object for key thing. I tried my best to make your code plist friendly, but it may not be perfect...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top