*connectToApp* is a method of *simulator*, so its code can refer to the *simulator* singleton as *this*.