Git Product home page Git Product logo

Comments (7)

futuretap avatar futuretap commented on May 10, 2024

When you're using custom cells, you're responsible for storing the value in NSUserDefaults. In the sample app, this is done by -[MainViewController textViewDidChange:].

from inappsettingskit.

azzoor avatar azzoor commented on May 10, 2024

are you talking about in the mainViewController.m file in this #pragma mark UITextViewDelegate (for CustomViewCell)

  • (void)textViewDidChange:(UITextView *)textView {
    [[NSUserDefaults standardUserDefaults] setObject:textView.text forKey:@"customCell"];
    [[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:@"customCell"];
    }

i am just stuck with how to determine which one has changed eg cusotmCell or customCelltwo

from inappsettingskit.

futuretap avatar futuretap commented on May 10, 2024

yep!

from inappsettingskit.

azzoor avatar azzoor commented on May 10, 2024

forgive me for being a noob at this but how can i determine which forKey to set? i am assuming it would be something like

if (key.title isEqualtoString:@"customCell"){
[[NSUserDefaults standardUserDefaults] setObject:textView.text forKey:@"customCell"];
[[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:@"customCell"];

} else if (key.title isEqualtoString:@"customCellTwo"){
[[NSUserDefaults standardUserDefaults] setObject:textView.text forKey:@"customCellTwo"];
[[NSNotificationCenter defaultCenter] postNotificationName:kIASKAppSettingChanged object:@"customCellTwo"];
}

from inappsettingskit.

azzoor avatar azzoor commented on May 10, 2024

is there already a builtin function to determine this and i am just over looking it?

from inappsettingskit.

futuretap avatar futuretap commented on May 10, 2024

Oh, now I get what you mean. Indeed, you need a mechanism to differentiate the textViews. I recommend setting different tags in your -tableView:cellForSpecifier: method. Like cell.textView.tag = 1 for your first textView and 2 for your second. Then, in your -textViewDidChange:method, you can check for the tag and set your key depending on that. Be aware that tags are integer values so you can't directly use the key here.

from inappsettingskit.

azzoor avatar azzoor commented on May 10, 2024

thats great i didnt know you could use the tag like that. A++ for you my friend.

from inappsettingskit.

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.