Your second setPredicate
overwrites the first one. You do not need it. You get the whole entity and then simply access the firstName
property. Your first predicate has wrong syntax.
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"RecordTable"];
request.predicate = [NSPredicate predicateWithFormat:
@"username==%@ AND password==%@",L_usernameField.text,L_passwordField.text];
NSArray *result = [self.managedObjectContext executeFetchRequest:request error:nil];
RecordTable *user = result.firstObject;
if (user) {
NSLog(@"The first name is %@.", user.firstName);
}
BTW, why does your method start with a capital letter? That is a very bad habit. Your entity name is also a disaster. "RecordTable" is about the worst entity name you could choose. If it is a user, call it "User". Following convention, I camel-cased your firstName property as well.