Hi everyone.
Let's see if I can explain myself.
I have some table views that I've populated with info from a .plist file. There I have no problems, since all the rows and subviews look fine.
At the end, the object is that each row has to open a different .txt file in a text view.
I've tried to do the same thing that I did in another project where the table view was populated from an array:
Code:
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSString *filepath = [[NSBundle mainBundle] pathForResource:textSelected ofType:@"txt"];
if (filepath) {
NSString *myText = [NSString stringWithContentsOfFile:filepath encoding:NSUTF8StringEncoding error:NULL];
if (myText) {
Article.text = myText;
}
}
}
Sadly, it isn't working.
The problem is that now each row opens the same .txt file (The first one of the list/bundle).
Also I have some rows in the last table view that have the same name, so how can they open a different file?
Ex. of my .plist
Rows
-item 0
---Children
-----Item 0
-------Title 1A (Should open file1.txt)
---Title 1
-Item 1
---Children
-----Item 0
-------Title 1A (Should open file2.txt)
---Title 2
Do I have to use some code like “If, else”?
Could you help me please?
Thank’s in advance.