my own personal belief is that Rin died before that. Rin dying obviously means alot to Obito and it was probably very easy for Madara to manipulate Obito after this. Madara would have known about the seal because for some reason i imagine at one point Madara and Hashi werent always rivals and enemies and he had to have known from soemwhere that the seal weakened during that time.
i think Madara was hasty to attack konoha before his death and told Obito some bullcrap like, if you get the kyubi from the host ill revive Rin or show you how or you can get revenge on your sensei by taking away his wife and kid and while your at it attack the village with the fox to make yourself known. Obito i imagined probably adopted Madara's ID shortly after Madara's death and the fox attack probably happened after (obviously) and Obito was combined with swirly zetzu and he just went pyscho again. Swirly zetzu has to have more to do with it than we think because even though hes behind tramatized by Rins death, i dont see him killing off his sensei and innocent wife and child for revenge. Also, if it was Obito attacking out of revenge, why didn't he try and kill Kakashi....as a matter of fact..