It looks like you're new here. If you want to get involved, click one of these buttons!
#import <UIKit/UIKit.h>
@interface ResultsCustomCell : UITableViewCell
{
IBOutlet UILabel *customLabel;
IBOutlet UITextView *snippet;
IBOutlet UIImage *newsImage;
}
@property (nonatomic, retain) IBOutlet UILabel *customLabel;
@property (nonatomic, retain) IBOutlet UITextView *snippet;
@property (nonatomic, retain) IBOutlet UIImage *newsImage;
@end
#import \"ResultsCustomCell.h\"
@implementation ResultsCustomCell
@synthesize customLabel, snippet, newsImage;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
#import \"ResultsCustomCell.h\"
// Populate TableView cells with contents of array.
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @\"CellIdentifier\";
ResultsCustomCell *myCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NewsArticle *n = (NewsArticle *)[appDelegate.articles objectAtIndex:indexPath.row];
myCell.customLabel.text =n.newsHeading;
myCell.snippet.text = n.articleText;
myCell.newsImage = [UIImage imageNamed:@\"newimage.jpg\"];
return myCell;
}
Replies
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI have then link this up to the custom cell in Interface builder. But still nothing showing.
Do I need to change this in the view controller?
At present is remains the same at:
ViewController.m
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomePerhaps there was a lack of clarity in my last post as it was more asking for advice on how to correct that code in the ViewController.m
How can I correct the statement?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeAre you going to try to fix your code, or just wait until someone hands it to you? Being a beginner is no excuse for being a beggar. You got far enough along to come up with the code in your first post, so this shouldn't be beyond your skill level.
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI was simple asking for advice on a subject which I really have little knowledge of. As you stated above I've made effort to create the code in my first post, so would I really ask this question without doing the research first?
I will go and read further into the differences between UIImage and UIImageView. I only prolonged this quarrel because I felt you could have been a little more welcoming.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSee, the actual thing to do before asking what changes to make is to try something for yourself. You will either solve the problem, or you will have different code that still doesn't work. Either way you will learn something, and either way you will have different code. If you still can't get it to work, THEN you come back, AND you show that code, and describe the nature of the remaining issues. This would prove that you are making an attempt at solving the problem yourself, which greatly increases my willingness to help you.
In the absence of that, the only assumption I can make is that you didn't actually write the code you've shown so far, and that you only copy-pasted it from a Google search. You don't actually understand a single line of it, and will have essentially zero ability to augment it. Depending on your maturity level, you will just continue begging and begging until someone gets tired of the whining and types out more code that you can copy-paste again and be on your way until you quickly hit the next problem.
So you can take issue with my demeanor all you want, but so far you have not advertised yourself as someone who is worth much more of my time. I am more than happy to help people who make an effort. If you are one of those people, then you need to do a better job of demonstrating that. The code in your second post should have had a great big warning in Xcode, and probably crashed when you tried it. Your response does not indicate either of those outcomes. So either you didn't actually try it in Xcode (which really irritates me), or you didn't copy-paste your actual code here (which also really irritates me), or you have bigger issues.
But at the end of the day, my demeanor is my decision. If you want the friendly version, you can pay for it. I'll help you to get an answer in here for free. Maybe. If you want roses too, you have to buy dinner first. You are getting free help here. I'm under no obligation to provide that (or anything, really) in a "welcoming" way, whatever that means to you. So far, I'm guessing that you define "welcoming" as "hand me some code now".
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomepardon if there is any mistakes, this is just of the top of my hat
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeYour assumptions are incorrect and your reply above makes you look bitter, cold and personally not worth MY time.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeNow would you care to provide something that might lead to a solution to your problem?
SlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome