Step 1:
if custom objects (say class objects ) are used then
-(id) initWithCoder:(NSCoder *)aDecoder
-(void) encodeWithCoder:(NSCoder *)aCoder
methods in your custom class and have to use NSCoding protocol
Step 2:
in order to retrieve the data from the .bin file
NSFileManager * fm = [NSFileManager defaultManager];
NSURL * docsURL =[fm URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil];
// this will create the file yourFile.bin if it is not present
NSString * path = [[docsURL path]stringByAppendingString:@"/yourFile.bin"];
self.yourArray = [NSKeyedUnarchiver unarchiveObjectWithFile:self.path];
Step 3:
if you want to save the data on to a .bin file
NSFileManager * fm = [NSFileManager defaultManager];
NSURL * docsURL =[fm URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil];
this will uses your file if present else it will create it
NSString * path = [[docsURL path]stringByAppendingString:@"/yourFile.bin"];
[NSKeyedArchiver archiveRootObject:self.recordedPlayers toFile:self.path]
that's it, your code should work properly by storing data on to file and retrieve it when you ask for it...
Hope this will solve the problem