Here is some code
aSong.songDuration = currentElementValue;
NSLog(@"SD = %@",aSong.songDuration); // Here aSong.Duration is right
[viewController.songs addObject:aSong];
Music *bSong = [viewController.songs objectAtIndex:1]; // here bSong.Duration is null
NSLog(@"bSong = %@",bSong.songDuration);
I tried different objectAtIndex but all the time the value is null. Is something wrong?
thanks
If you are adding an element to an empty mutable array, it has the index
0:Of course that is assuming
songsactually is aNSMutableArray(not anNSArray, which is immutable) and thatsongsexists.