Xcode 8 issue - JS ERROR TypeError: NSNotificationCenter.defaultCenter is not a function.
See original GitHub issueThanks for the very handy module!
I upgraded to Xcode 8 and Nativescript 2.3.0, and I’m using 1.1.2 of this module.
My app is crashing as soon as the module is referenced. I tried installing your demo app with the following in the package.jspn
file:
{
"nativescript": {
"id": "org.nativescript.localnotifications",
"tns-android": {
"version": "2.3.0"
},
"tns-ios": {
"version": "2.3.0"
}
},
"dependencies": {
"nativescript-local-notifications": "1.1.2",
"tns-core-modules": "2.3.0"
},
"devDependencies": {
"babel-traverse": "6.8.0",
"babel-types": "6.8.1",
"babylon": "6.8.0",
"filewalker": "0.1.2",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.3.1",
"typescript": "^1.8.2"
}
}
The app builds and then crashes with the following error:
Sep 17 08:30:10 raef LocalNotifications[28139]: file:///app/tns_modules/nativescript-local-notifications/local-notifications.js:4:44: JS ERROR TypeError: NSNotificationCenter.defaultCenter is not a function. (In 'NSNotificationCenter.defaultCenter()', 'NSNotificationCenter.defaultCenter' is an instance of NSNotificationCenter)
Sep 17 08:30:10 raef com.apple.CoreSimulator.SimDevice.A02F4667-157D-4C2F-8665-8DBA15F8995C.launchd_sim[19818] (UIKitApplication:org.nativescript.localnotifications[0x9b6a][28139]): Service exited due to Segmentation fault: 11
This is the same error I am getting in my project.
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Send and receive messages through NSNotificationCenter in ...
Just wondering where [NSNotificationCenter defaultCenter] is meant to placed. Is it best to place it in your AppDelegate? – fulvio. Jan 12, 2011 ......
Read more >NSNotification selector method not… | Apple Developer Forums
I've set up a notification added to a NSButton: Class X. post notification: [[NSNotificationCenter defaultCenter] postNotificationName:@"cbCheckBoxEntred" ...
Read more >NSDistributedNotificationCenter - Documentation
Specifies that an object no longer wants to receive certain notifications. Overview. Each task has a default distributed notification center that you access ......
Read more >addObserverForName:object:queue:usingBlock
Adds an entry to the notification center to receive notifications that passed to the provided block.
Read more >Error: Type 'UIResponder' has no member 'NSNotification'
After updating OS and Xcode I get errors from external librarys. The initial error is: 'keyboardWillShowNotification' has been renamed to 'NSNotification.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the quick test, published 1.1.3.
@EddyVerbruggen worked like charm. Thanks, mate.