I have an view in an app that is a help feature.
This view consists of textview and a tableview. The table view consists of a load of questions, when user selects a question it displays the answer in the UITextView
.
What I'm trying to do is hardcode this data. Now i can get views to work nice and easy just code behind isn't the cleanest and with the questions and answers always changing, I want this data easily stored. What I'm thinking is a NSMutableArray something like this.
NSMutableArray *HelpPage = [NSMutableArray arrayWithObjects: <answers,questions here>
how do I put say something like this in
NSMutableArray* HelpPage = [NSMutableArray arrayWithObjects:
@"How do i close", @"Press close button"
@"How do i open", @"Press the open button",
Btw I should add these are only examples lol.
ideally I'd like it in its separate .h/.m file so people can just send me updated versions and I don't have to spend ages merging stuff.
Is NSMutableArray
best way of doing this?
in other areas of the app, i record users ethnicity, what i did here was
.h file
+ (NSArray*) ArrayofEthnicity;
.m file
+ (NSArray*) ArrayofEthnicity{
return [NSArray arraywithObjects: @"English", @"French", @"German", nil];
}
and each time i need it calling
NSArray* Data = [EthnicityData ArrayofEthnicity];
is there a better way of doing this?
Thanks