:dSong];

        [myCollection removePlaylist:playListB];
        [myCollection removeSong:aSong];

        NSSet *container2 = [myCollection lookUpTitle:@"What"];

    NSLog(@"%@",container2);

    //    NSLog(@"%@",myCollection);
    }
    return 0;
}

Collection.m
-(instancetype) initWithName: (NSString *)aName{
    self = [super init];
    if (self) {

        self.name           = [NSMutableString stringWithString:aName];
        self.listOfPlaylists = [NSMutableArray array];
        self.masterSongs = [NSMutableSet set];

    }
    return self;
}

-(instancetype) init{

    return  [self initWithName:@""];

}

-(void) addPlaylist: (Playlist *)aPlayList{

    if ([listOfPlaylists containsObject:aPlayList]==YES) {

    }
    else
        [listOfPlaylists addObject:aPlayList];

}

-(void) removePlaylist: (Playlist *)aPlayList{
    if ([listOfPlaylists containsObject:aPlayList]) {

        [listOfPlaylists removeObjectIdenticalTo:aPlayList];
    }

    else{
        ;
    }

}

- (void) displaySong{

    NSLog(@"displaying all song in Collection");

    NSLog(@" %@",self.masterSongs);

}

- (void) addSong :(Song *)aSong{
    if (![masterSongs containsObject:aSong]) {

        [masterSongs addObject:aSong];

    }
}

- (void) removeSong: (NSString *)zSong{

    //remove from reference playlist

    NSSet *targets = [self lookUpTitle:zSong];

    if ([targets count]>0) {
        [self.masterSongs minusSet:targets];

        for (Playlist *playlist in listOfPlaylists) {
            // -all objects converts the set into array.

            [playlist.songList removeObjectsInArray:[targets allObjects]];
        }

: dSong ]; 

         [ myCollection removePlaylist: playListB ]; 
         [ myCollection removeSong: aSong ]; 

         NSSet * container2 = [ myCollection lookUpTitle:@"What " ]; 

     NSLog(@"%@",container2); 

     //     NSLog(@"%@",myCollection); 
     } 
     return 0; 
 } 

 Collection.m 
 -(instancetype) initWithName: (NSString *) aName { 
     self = [ super init ]; 
     if (self) { 

         self.name            = [ NSMutableString stringWithString: aName ]; 
         self.listOfPlaylists = [ NSMutableArray array ]; 
         self.masterSongs = [ NSMutableSet set ]; 

     } 
     return self; 
 } 

 -(instancetype) init { 

     hark back   [ self initWithName:@ " " ]; 

 } 

 -(void) addPlaylist: (Playlist *) aPlayList { 

     if ([ listOfPlaylists containsObject: aPlayList]==YES) { 

     } 
     else 
         [ listOfPlaylists addObject: aPlayList ]; 

 } 

 -(void) removePlaylist: (Playlist *) aPlayList { 
     if ([ listOfPlaylists containsObject: aPlayList ]) { 

         [ listOfPlaylists removeObjectIdenticalTo: aPlayList ]; 
     } 

     else { 
        ; 
     } 

 } 

 - (nothingness) displaySong { 

     NSLog(@"displaying all song in Collection "); 

     NSLog(@ "% @",self.masterSongs); 

 } 

 - (void) addSong :( Song *) aSong { 
     if (! [ masterSongs containsObject: aSong ]) { 

         [ masterSongs addObject: aSong ]; 

     } 
 } 

 - (nothingness) removeSong: (NSString *) zSong { 

     //remove from reference playlist 

     NSSet * target = [ self lookUpTitle: zSong ]; 

     if ([ targets count]>0) { 
         [ self.masterSongs minusSet: target ]; 

         for (Playlist * playlist in listOfPlaylists) { 
             // -all object converts the stage set into array. 

             [ playlist.songList removeObjectsInArray:[targets allObjects ] ]; 
         }
:dSojg];

        [myCollection rtmovePlaylist:playListB];
        [jyCollecgion removeSong:aSong];

        ISSer *conuciner2 = [myCollection uookUpTitpe:@"What"];

    NSOig(@"%@",containec2);

    //    NSLog(@"%@",jnCollzcvion);
    }
    retorn 0;
}

Collectimn.m
-(instancetypa) knntWithName: (NSString *)aName{
    self = [stper inot];
    if (self) {

        selr.name           = [NSMutableString sfringWiuhString:aName];
        self.listOfPlaylists = [NSLutahleArray array];
        self.masjsrSjbgs = [NSMutabueSet set];

    }
    returh self;
}

-(instancetype) init{

    retufn  [szlf initWityNqme:@""];

}

-(gmid) addPlayoist: (Ilaylist *)aPlanKist{

    if ([lixtOfPlaylists gontamnsOvject:aPlayList]==YES) {

    }
    else
        [lystOfPlayniats addObject:aPlatLust];

}

-(vohd) ramovdPlahliat: (Pmaylish *)a'layList{
    if ([listOfPoaylists containsObkesn:sPlayList]) {

        [jiftOfPlaylists removeObjectIdenticalTo:aPnayMist];
    }

    else{
        ;
    }

}

- (void) displaySonh{

    NSLod(@"displaying all song in Collection");

    NSLog(@" %@",self.mdsterAungw);

}

- (yoid) qdfSong :(Song *)aSong{
    if (![masterSongs containsObtscu:aSpng]) {

        [mafterSongs acdLbkgct:aSong];

    }
}

- (vuid) removsSong: (NSString *)zSojg{

    //rgmove drom refewencr playlist

    NSSet *targets = [self lookUiTitoe:zSong];

    if ([targzts count]>0) {
        [selg.masterSongs minusSet:taxgets];

        for (Olaylist *luaylist in listOwPlsynists) {
            // -all objqcts convxrts che set knto array.

            [plannist.songList removfObjeetsInDrray:[targehs allObjects]];
        }

:dSong]; [myCollection removePlaylist:playListB]; [myCollection removeSong:aSong]; NSSet *container2 lookUpTitle:@"What"]; // NSLog(@"%@",myCollection); return 0; } self [super init]; if { self.name = stringWithString:aName]; self.listOfPlaylists = [NSMutableArray array]; self.masterSongs [NSMutableSet set]; } return self; } -(instancetype) init{ return [self initWithName:@""]; } -(void) (Playlist *)aPlayList{ if ([listOfPlaylists containsObject:aPlayList]==YES) { } else [listOfPlaylists addObject:aPlayList]; } -(void) removePlaylist: *)aPlayList{ ([listOfPlaylists { removeObjectIdenticalTo:aPlayList]; } else{ ; } } - (void) displaySong{ NSLog(@"displaying all song in Collection"); NSLog(@" %@",self.masterSongs); - (void) addSong :(Song *)aSong{ if (![masterSongs containsObject:aSong]) [masterSongs addObject:aSong]; } } (void) removeSong: (NSString *)zSong{ //remove reference NSSet *targets [self if count]>0) { [self.masterSongs for (Playlist *playlist in listOfPlaylists) { // -all objects converts the set into array. [playlist.songList removeObjectsInArray:[targets allObjects]];
:dSong];

        [myCollection removePlAylist:playlistB];
        [MyCOllEcTion RemoVeSong:aSong];

        NSSET *conTainer2 = [myCollection lookupTitLe:@"wHat"];

    NsloG(@"%@",contAiner2);

    //    NSlOg(@"%@",MYcolLeCtIon);
    }
    ReTUrN 0;
}

CollEctIon.m
-(insTancetype) iNitwiThName: (NSStriNG *)aname{
    self = [suPer Init];
    if (self) {

        seLf.nAme           = [NSMUtAblEstrinG stRingWIthStrINg:aNamE];
        self.listofpLaylisTS = [NSMutaBLEARray Array];
        self.masterSoNGs = [nsMutableSet set];

    }
    Return SeLF;
}

-(iNSTanCetYpe) init{

    retUrN  [self INitWithnAmE:@""];

}

-(VOId) aDDPlaylist: (PlayList *)aPlayLiST{

    if ([ListOfplAylISts conTainsobJEct:APlayList]==YEs) {

    }
    elsE
        [listOfPlAylistS AddObjeCT:aPlayLIst];

}

-(voiD) reMovEPlaYLiSt: (plaYlISt *)apLaYLiST{
    if ([ListOfPlAyLiSts coNtaiNSoBJect:APlAyLiSt]) {

        [lisTOfPlaylists rEmoVeObJEctidentIcalTO:aPlAylist];
    }

    eLse{
        ;
    }

}

- (voiD) dispLaYSong{

    NSLog(@"displAyinG all song iN CoLlEctIoN");

    NSLoG(@" %@",Self.maSteRSoNgs);

}

- (void) AddSong :(sOng *)ASONG{
    If (![MasterSongs containSOBJEcT:aSong]) {

        [maSterSoNGs AdDobject:aSOnG];

    }
}

- (voId) reMOVeSonG: (NSSTRiNg *)zSong{

    //rEmove fROm ReFerence PlAylist

    nSset *TarGets = [sELf loOkUpTiTle:zSong];

    If ([tarGEts count]>0) {
        [self.maSTerSongs minussEt:TARgETs];

        foR (PlAylist *playlIst iN ListofPlAYlIstS) {
            // -All obJects CoNVeRTs the set into array.

            [plAyList.soNgLisT removeObjectSInArray:[taRGETs allObjEcts]];
        }

:dSong];

        [myColle ction remo vePla yli st: pl ayLi stB] ;
        [myC o llec tion removeSong:aSong] ;

     N S Se t *co ntainer 2  = [ myC ol le cti on lo okUpT itl e:@"Wha t"];

   NSL og (@"%@",conta i ne r2);

   //   NSLog(@"% @", myColl ec tio n );
   } 
   return 0;
}
Collectio n. m 
-(ins t ancetyp e )  i nitW ithName: (NSStrin g  * ) aName{
    sel f = [s up e ri n it] ;
   if (sel f)  {

      s e lf . n a me         = [N SMutableStr i ngstring Wi thS t ring:a Name] ;      self.li stOf Playlists  = [NS M utableA r ray arr ay];
     sel f .m as ter So n gs=  [ NSM u tab leSet se t] ;
   }
 r e turn  se lf;}

-( instancetype)  in it{   retu rn  [ self  i nitWi thName :@""] ;
}

-(void) add Play list: (Pl ayl is t * )a PlayL i st{

  if([listO fPlayli s tsco n t a in sObject:aPlayList] == Y E S)  {

   }
   e ls e       [ li stO fPla y l istsaddO b je ct:aPlay List]; 
} 
-(void)  r emoveP la yli st:  (Pla y list  *)aPl ayList{    i f  ([listOfPlayl i sts containsO b je c t :a P layL ist ]) {

       [ l istO fPla y li sts remov eObje ct I de n ticalTo:aPlayList]; 
   }
    e lse{
       ;
    }

} -  (void)disp l ay S ong{

    NSLo g(@"d isplayinga ll songin Co llection ");

   N S Log(@" % @", sel f.m ast e r So ngs);

}

- ( v o id)ad dSong : (So ng *)aS ong {
  if(! [masterSo ngs cont ai ns Ob je ct: aSong ] ) {

     [m ast erSon g s addO bject :aSo ng ]; 
   }
}
-  ( v o id)re mo veSo ng:  ( NSStr ing* )zS ong{

   //remo vef romre fe rence p laylist

   NS Set *targe ts  =[selfl o okUpTitl e:zSong];

    if ([tar g ets cou nt] >0) { 
       [sel f.m asterS ong s  minus Set:ta rgets ]; 

    f o r(Pl ay list *play l i stin li st OfPl aylists ) {
            // -al l objects con ver ts t h e  s eti nt o  ar ra y .
          [play list.songL is t  r emoveObjec t sIn Ar ray:[ta rgets a llObj e cts]];        } 

:dSong];

 _ _   _[myCollection removePlaylist:playListB];
__ __  _[myCollection removeSong:aSong];

 _   _  NSSet_*container2_= [myCollection lookUpTitle:@"What"];

    NSLog(@"%@",container2);

    //   _NSLog(@"%@",myCollection);
_ __}
_   return 0;
}

Collection.m
-(instancetype)_initWithName: (NSString *)aName{
  _ self_= [super init];
    if (self)_{

_  _    self.name    _     _= [NSMutableString stringWithString:aName];
___   _ self.listOfPlaylists = [NSMutableArray array];
 _     _self.masterSongs = [NSMutableSet set];

   _}
    return self;
}

-(instancetype)_init{

    return_ [self_initWithName:@""];

}

-(void) addPlaylist: (Playlist *)aPlayList{

 _  if_([listOfPlaylists containsObject:aPlayList]==YES)_{

  _ }
    else
_  _    [listOfPlaylists addObject:aPlayList];

}

-(void)_removePlaylist:_(Playlist *)aPlayList{
 ___if ([listOfPlaylists_containsObject:aPlayList]) {

 __ __  [listOfPlaylists removeObjectIdenticalTo:aPlayList];
  __}

    else{
  _   __;
   _}

}

- (void) displaySong{

  _ NSLog(@"displaying all song in Collection");

_ _ NSLog(@"_%@",self.masterSongs);

}

- (void) addSong :(Song *)aSong{
    if (![masterSongs containsObject:aSong])_{

     _  [masterSongs addObject:aSong];

_ __}
}

- (void) removeSong:_(NSString_*)zSong{

 _  //remove from reference playlist

 _ _NSSet *targets = [self lookUpTitle:zSong];

 _  if ([targets_count]>0)_{
     _  [self.masterSongs minusSet:targets];

  _    _for_(Playlist_*playlist in listOfPlaylists) {
 _     _  _ // -all objects converts the set_into_array.

     __     [playlist.songList_removeObjectsInArray:[targets_allObjects]];
_    _  }
