0

How do I add the string below into the newscount object

NSString *path = [[NSBundle mainBundle] pathForResource:@"NewsStory1" ofType:@"txt"];
NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];


newscount = [[NSArray alloc] initWithObjects:[NSString *content],@"XXX", @"12345", nil];
1
  • Is this about a UITextView? There's no UITextView in your code sample. Commented Aug 29, 2011 at 22:52

2 Answers 2

2

Simpler and autoreleased:

newscount = [NSArray arrayWithObjects:content,@"XXX", @"12345", nil];
Sign up to request clarification or add additional context in comments.

Comments

0

so simple:

newscount = [[NSArray alloc] initWithObjects:content,@"XXX", @"12345", nil];

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.