Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zachsilvey

macrumors 6502
Original poster
Feb 5, 2008
444
3
Battle Ground
This line
Code:
NSLog(@"%@", arrayOfNewsItems);
will work in every method of my UITableViewController except
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

The array is a synthesized property so it should be accessible anywhere in the class but when I use that line inside of the that method the app crashes without throwing an exception in the console.
 
The array is a synthesized property so it should be accessible anywhere in the class but when I use that line inside of the that method the app crashes without throwing an exception in the console.

What does the rest of the method look like? Can you do just a regular "NSLog(@"I am here");" and have it work in there?
 
This line
Code:
NSLog(@"%@", arrayOfNewsItems);
will work in every method of my UITableViewController except
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

The array is a synthesized property so it should be accessible anywhere in the class but when I use that line inside of the that method the app crashes without throwing an exception in the console.

The NSLog you've posted is not using a synthesized property. It's using a variable named 'arrayOfNewsItems'. I can't tell you if it's a local variable or an instance variable or even a global variable without seeing more code. But it's definitely not a property.

You can tell it's not a property because this is what a property reference looks like:
Code:
NSLog(@"%@", [COLOR="Red"]self.[/COLOR]arrayOfNewsItems);
If you don't have the name of the object whose property it is, followed by a dot, then that arrayOfNewsItems is not a property.

And no one here is a mind-reader. If you expect someone to help you with the code in the method, then you have to post the code of that method.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.