English 中文(简体)
应用程序运行时执行背景任务的最佳方法
原标题:Best approach to implement background task while app is running

执行iOS任务的最佳方法是什么? iOS在应用程序运行时正在另一条线上做他的工作?

我想在应用程序运行时执行每10分钟检查一次更新的线索。 是否有这样的可能性可以执行这个线索? 我认为我无法执行一个无尽循环的线索, 因为苹果会拒绝这个应用程序, 对不对?

问题回答

您绝对不需要无休止闲置的线条, 但我无法想象苹果会拒绝您的应用程序, 因为< / em> 的原因: 但这根本不是好的应用程序设计 。

我怀疑你真正想做的是"a href=" http:// developmenter.apple.com/library/ios/#documentation/Cocoa/Confitual/Timers/Timers.html" Rel="nofollow" > "NSTimer ",该任务每10分钟运行一次 。

也可以发送 < a href=> http:// developer.apple.com/library/ios/document/Cocoa/Reference/Foundation/Classes/NSBject_Class/Reference/Reference.html#/aple_ref/occ/instm/NSBject/performSelector%3awithObject%3afterDelay%3a" rel="nofollow"_codecode>perforlector: withObject:afterDelay: 向一个对象发送信息,然后将此信息从一个单独的线索上除去用于背景工作 。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签