जब मेरा ऐप शुरू होता है तो मुझे एक विधि कॉल करने की आवश्यकता होती है और फिर प्रत्येक 5 सेकंड में एक ही विधि को कॉल करें।तुरंत एनएसटीमर को कैसे ट्रिगर करें?
मेरे कोड बहुत सरल है:
// Call the method right away
[self updatestuff:nil]
// Set up a timer so the method is called every 5 seconds
timer = [NSTimer scheduledTimerWithTimeInterval: 5
target: self
selector: @selector(updatestuff:)
userInfo: nil
repeats: YES];
वहाँ टाइमर तो यह ट्रिगर सही दूर है और फिर हर 5 सेकंड के लिए एक विकल्प है?
बहुत अच्छा वाक्य रचना! – loretoparisi