I have a UITextView
which I have created programmatically in the following code:
NSLog(@"creating the first blurb");
blurb = [[UITextView alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
[blurb setText:total];
blurb.backgroundColor = [UIColor redColor];
where blurb
is defined as a UITextView
in the @interface
.
Here's where I'm having the problem:
total
is an NSString
that is defined to get the text from a .txt
file from a specified domain.
It is mutated as:
NSString *url = @"https://sites.google.com/site/paloaltoapps/tbnappsource-password-blackr3d/Updates.txt";
NSURL *urlRequest = [NSURL URLWithString:url];
total = [NSString stringWithContentsOfURL:urlRequest encoding:NSUTF8StringEncoding error:nil];
However, when I run the code, I get an instance of EXC_BAD_ACCESS
thrown at the setText:
line of the top code block.
I have tried printing total
out using an NSLog
statement, and that seems to work just fine.
Can anyone see what I'm doing wrong? Thanks.