خرید بک لینک

Vote count: 0

I need to do an Int comparison on some data stored in my NSTimer's userInfo property. I currently am trying to use the < operator on the userInfo directly but I get the following error.

 Binary operator '<' caot be applied to operands of type 'Int' and 'AnyObject'

I understand why I am getting the error (userInfo isn't of type Int but of type AnyObject). However, everytime I initialize my NSTimer I populate its userInfo with the following:

 NSNumber(integer: nextIndex)

I would like to retrieve that nextIndex value from my stored version of the NSTimer in the following way:

        let userInfo = SharingManager.sharedInstance.globalTimer.userInfo

        if (userInfo < 2){ 
           //create new timer
        }else{
           //create a new timer with different properties
         } 

Any thoughts on how to do that?

asked 1 min ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 25 بهمن 1394 ساعت: 4:55

صفحه بندی