Code Monkey home page Code Monkey logo

Comments (16)

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

From @truongsinh on April 17, 2015 17:22

I will try in a moment!

from nativescript.

enchev avatar enchev commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

Will be available as a plug-in when http://plugins.telerik.com/ is ready.

from nativescript.

danicomas avatar danicomas commented on May 10, 2024

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.

enchev avatar enchev commented on May 10, 2024

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.

valentinstoychev avatar valentinstoychev commented on May 10, 2024

@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.

danicomas avatar danicomas commented on May 10, 2024

@valentinstoychev and Will we be able to use it in other page without ListView?

from nativescript.

valentinstoychev avatar valentinstoychev commented on May 10, 2024

@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.

danicomas avatar danicomas commented on May 10, 2024

@valentinstoychev issue created

from nativescript.

lock avatar lock commented on May 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.