The midrash says that Samson lost his strength because of his relationship with Delilah, a foreign woman, and not because his hair was cut, and that the angel who foretold Samson's birth to his mother knew that Delilah would cause him to break his Nazirite vow.