Comments (16)
From @hshristov on April 13, 2015 7:41
Hi truongsinh,
Could you try to remove the "" around myRefresh method? e.g.
public myRefresh (sender: UIRefreshControl) {
...
}
from nativescript.
From @truongsinh on April 13, 2015 18:38
@hshristov I tried that before. The only reason I used "" is to have "myRefresh:" instead of "myRefresh". However, I believe when transpiling to ES5, it's the same!
from nativescript.
From @truongsinh on April 13, 2015 18:40
Take a look at http://docs.nativescript.org/runtimes/ios/how-to/ObjC-Subclassing, search for
// A native class with the name "JSObject" will be registered, so it should be unique
class JSObject extends NSObject implements NSCoding {
public encodeWithCoder(aCoder) { /* ... */ }
public initWithCoder(aDecoder) { /* ... */ }
public "selectorWithX:andY:"(x, y) { /* ... */ }
// An array of protocols to be implemented by the native class
public static ObjCProtocols = [ NSCoding ];
// A selector will be exposed so it can be called from native.
public static ObjCExposedMethods = {
"selectorWithX:andY:": { returns: interop.types.void, params: [ interop.types.id, interop.types.id ] }
};
}
from nativescript.
From @hshristov on April 14, 2015 6:43
@truongsinh There are a lot of examples in the cross platform modules were we expose methods that are called from ObjC. Please take a look at Button.ios.ts.
https://github.com/NativeScript/cross-platform-modules/blob/master/ui/button/button.ios.ts
from nativescript.
From @truongsinh on April 14, 2015 6:48
Thanks. I tried to imitate those examples, but always got Segmentation Fault: 11
. Do you think it is because of something wrong with my script (i.e. if I write NativeScript correctly it will work), or with the logic itself (i.e. if I write that logic in ObjC, I still have Segmentation Fault: 11
)?
from nativescript.
From @PanayotCankov on April 17, 2015 11:40
addTargetActionForControlEvents keeps internally a weak reference, when the GC collects the rHandler the native object used as target is gone, its deallocated, calls to its methods result in seg fault. etc. Would you try keeping the rHandler in a var in the module, that would keep it alive.
E.g. move the "var rHandler" outside the pageLoaded function, or even export it on the module?
from nativescript.
From @truongsinh on April 17, 2015 17:22
I will try in a moment!
from nativescript.
From @truongsinh on April 17, 2015 17:41
@PanayotCankov yes it works, thank you very much! I'll keep this issue open and try to make a PR for this feature, as I believe it is quite popular!
from nativescript.
Will be available as a plug-in when http://plugins.telerik.com/ is ready.
from nativescript.
Roadmap @enchev? and this control could be used in other page without ListView? Sometimes we need to refresh data in a page detail.
from nativescript.
My suggestion actually was to @truongsinh to create plugin instead this pull request. In this way we will not break the current ListView.
from nativescript.
@danicomas Pull to refresh will be available later this month for the Telerik ListView, part of the Telerik UI for NativeScript. @ginev can share more.
from nativescript.
@valentinstoychev and Will we be able to use it in other page without ListView?
from nativescript.
@danicomas not in this first version. But I love the idea! We should be able to easily implement it. Do you want to open a separate issue for this so that it doesn't get lost?
from nativescript.
@valentinstoychev issue created
from nativescript.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from nativescript.
Related Issues (20)
- Support Apple's "Vision" framework for on-device OCR text recognition HOT 4
- minHour and minMinute crash the app on TimePicker HOT 1
- TextField with [secure] string don't work on Android with core plugin 8.6.2 HOT 10
- ns build iOS and Xcode build not working after upgrade to xcode 15 HOT 5
- ResumeEvent in a component's constructor not triggering
- TypeError: Cannot read properties of undefined (reading 'env')
- Transfer nativescript.org Domain To The OpenJS Foundation
- RootLayout enterFrom animation bugged on iOS
- ReferenceError: NSURLSessionConfiguration is not defined HOT 12
- Missing API declarations & calling of restricted APIs HOT 8
- Android apps becomes unresponsive after resolution change
- NS PREVIEW don't working properly HOT 8
- Overlap using GridLayout iOS issue HOT 1
- [Known Issue] `npm i -g nativescript` error: gyp: binding.gyp not found HOT 2
- [feature] Allow bundler, eslint and typings generator to show API/SDK version availability warnings
- Upgrading to @nativescript/webpack-5.0.19 requires upgrade to @nativescript/core-8.7.0 HOT 3
- Devtools 0.0.1 Error: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String HOT 1
- [android] Image tintColor set to null will cause a throwable
- Uncaught ReferenceError: NativeScriptViewFactory is not defined on iOS built with mode --release. HOT 18
- Frequent ANR: __cxa_throw ANR triggered by slow operations in main thread HOT 2
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 nativescript.