Comments (10)
could you give more info? OS version, crash log?
from swiftytimer.
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000043000002
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x19860dbc8 objc_msgSend + 8
1 CoreFoundation 0x1839f3580 -[__NSCFTimer fire] + 120
This is happening on every device, every OS I tried (iOS, iPhone)
from swiftytimer.
Looks like the CFTimer β NSTimer bridging is lacking, and a bridged timer doesn't actually have a fire()
method...
It is an edge case, but still worth reverting to the old method of initializing timers...
@BenchR267 Would you mind filing the bug with Apple (bugreport.apple.com), so that it's also fixed for everyone?
from swiftytimer.
Oh yeah, sorry, forgot to answer. I'll create a bugticket at Apple.
from swiftytimer.
@radex Will you revert to the old way anytime soon? Asking because you said you would, but there have been no changes to that.
from swiftytimer.
I intend to⦠The trouble is that if I do that, I lose compatibility with SwiftPM (old method requires ObjC runtime)... Perhaps a conditional implementation (Using either CFRunLoopTimer
API or the new block-based API) would do the job. PRs welcome.
from swiftytimer.
Is there a workaround for this? Its crashing my app as well.
from swiftytimer.
@scisci we are using an older version of SwiftyTimer which doesn't have the issues.
from swiftytimer.
I also encountered this issue, The context is if the user is about to switch views that if a certain timer that calls a function to hide certain messages has not done so when its about to switch, it fires then invalidates the timer.
So instead of fire()
i set the fireDate
to now and then have a completion block for any code that needs to happen after the timer has fired (e.g invalidating after firing). If the code after the call is not dependant on the timer firing it does not need to be in the block.
typealias VanillaClosure = () -> Void
@objc(fireNowThen:)
func fire(completionBlock: VanillaClosure?) {
fireDate = Date()
MTq.after(0.1) {
completionBlock?()
}
}
MTq is a legacy obj-c library, which is just syntax sugar for GCD that could easily be GCD or any other GCD-esque library
from swiftytimer.
This just got me as well, a bummer!
Luckily in this project I targeted iOS 10, which does have a Timer API that is closer to SwiftyTimer in simplicity and elegance.
from swiftytimer.
Related Issues (20)
- Use default arguments naming HOT 2
- How to stop started timer ? HOT 4
- Include NSTimer in block? HOT 7
- NSTimer.new -> NSTimer.init HOT 2
- Add Swift Package Manager support HOT 4
- Convert separate test project into a XCTest-based test target HOT 5
- Add Travis CI HOT 2
- Support lower deployment targets than 10.11 HOT 2
- How to stop a timer in this timer's closure? HOT 4
- userinfo ? HOT 5
- SwiftyTimer is not compatible with Swift 3.0 HOT 1
- Swift 2.3 compile error HOT 4
- Publish swift 3 code to cocoapods HOT 2
- Usage issue HOT 3
- is it supposed to work on a background queue? HOT 2
- Can't figure out how to stop timer
- Timer not working in background
- Swift 4.0 HOT 3
- Swift 5 support?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftytimer.