My code compiles fine but doesn't show the text from mathspractice.txt
-(void)loadText
{
NSBundle *bundle = [NSBundle mainBundle];
NSString *textFilePath = [bundle pathForResource:@"mathspractice" ofType:@"txt"];
NSString *fileContents = [NSString stringWithContentsOfFile:textFilePath];
NSArray *mathsPracticeTextArray = [[NSArray alloc] initWithArray:[fileContents componentsSeparatedByString:@" "]];
self.mathsPracticeText = mathsPracticeTextArray;
[mathsPracticeTextArray release];
}
and:
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,100,960,40)];
myLabel.text = [mathsPracticeText componentsJoinedByString:@" "];
[myScrollView addSubview:myLabel];
[myLabel release];
can anyone tell me why?