« first day (22 days earlier)    last day (15 days later) » 

5:09 PM
@meda Hey! :)
 
@Brittany
I went through your code
you did not implement my suggestion
 
I thought I did...?
 
No
you cannot set an image directly
instead pass it the image name
 
Ohhh hold on I may've missed that bit lol
So I have this in the bottom of my tableviewcontroller.m...
But re this line: featureImage.image = [UIImage imageNamed:_imageName];
My image is being pulled from a URL
(I'm pulling my data from a MySQL database with JSON output)
Which is why I skimmed down the URL into cellImageLink (displaying the image in my tableview works just fine). So I don't know the image name per say, just the string that contains the image URL.
E.g. every post has a different image
FullArticleViewController *viewController = [[FullArticleViewController alloc]
initWithNibName:@"DetailViewController"
bundle:nil];
viewController.featureImage = searchResults[indexPath.row][@"Image"][@"filename"];
[self.navigationController pushViewController:detailViewController animated:YES];
}
 
okay so its not a big change
pass the image url to the next detailview
and download it there
you are using SDWebimage right
 
5:14 PM
I am!
 
 [self.featureImage sd_setImageWithURL:_imageName];
 
Before I had this line in my detailViewController (in the ViewDidLoad)... [featureImage.image sd_setImageWithURL:[NSURL URLWithString:cellImageLink]];
How would the app know what _imageName is though? Am I missing something lol?
 
okay so it should be :
FullArticleViewController *viewController = [[FullArticleViewController alloc]
initWithNibName:@"DetailViewController"
bundle:nil];
viewController.cellImageLink= searchResults[indexPath.row][@"Image"][@"filename"];

[self.navigationController pushViewController:detailViewController animated:YES];
whatever property you have that will hold the image name
 
Ok so -technically-, shouldn't that line in detailviewcontroller be: [self.featureImage sd_setImageWithURL:cellImageLink];
?
 
technically you can call it any name you want, it has to be an NSSString
 
5:20 PM
These are the properties in the detailView's header: @property (nonatomic, copy) NSDictionary *articleDetail;
@property (strong, nonatomic) IBOutlet UIImageView *featureImage;
@property (strong, nonatomic) NSString *cellImageLink;
 
exactly
dont use featureImage in your tableView at all
 
Ok cool. but strange; xcode throws me a warning when I use cellImageLink lol
(Incompatible pointer types sending NSString to type NSURL
 
which line
please show
 
[self.featureImage sd_setImageWithURL:cellImageLink];
 
sd_setImageWithUL needs a url
[self.featureImage sd_setImageWithURL:[NSURL URLWithString:cellImageLink]];
 
5:27 PM
ahhh k hold on :)
wow, still nothing lol. What the heck! hahaha
its saying cellImageLink is null in my detailviewcontroller
I don't understand why it's not being passed/set O_o
 
viewController.cellImageLink= searchResults[indexPath.row][@"Image"][@"filename"];
Log it
NSLog(@"viewController.cellImageLink = %@",viewController.cellImageLink);
@Brittany
 
Gotcha
null as well
viewController.cellImageLink = (null)
 
5:49 PM
ok
we will sort this out
NSLog(@"searchResults[indexPath.row] = %@",searchResults[indexPath.row];
@Brittany
 
hahhah you're a gem
 
Because I do not give up aha
 
I'm just running out to grab lunch; I'm leaving this window open though so if you come up with something post away and I'll see it when I get back. Won't be long! :)
I feel like Stack should have a mobile app chat lol
 
it has
but ok
I will try to run it
 
6:05 PM
Awesome :) And oooh I'll download it!
 
6:16 PM
I think this is what you want
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
	FullArticleViewController *detailViewController = [[FullArticleViewController alloc]
									initWithNibName:@"FullArticleViewController" bundle:nil];
	if ([searchResults count]) {
		detailViewController.title = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"node_title"];
		detailViewController.articleDetail = [searchResults objectAtIndex:indexPath.row];
		detailViewController.cellImageLink = searchResults[indexPath.row][@"Image"][@"filename"];
PLEAse ignore this code above
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

	FullArticleViewController *detailViewController = [[FullArticleViewController alloc]
									initWithNibName:@"FullArticleViewController" bundle:nil];
	if ([searchResults count]) {
		detailViewController.title = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"node_title"];
		detailViewController.articleDetail = [searchResults objectAtIndex:indexPath.row];
		detailViewController.cellImageLink = searchResults[indexPath.row][@"Image"][@"filename"];
 
6:47 PM
0
A: How to pass a UIImageView from UITableView (custom cell) to DetailViewController?

medaMyTableViewController.m - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { FullArticleViewController *detailViewController = [[FullArticleViewController alloc] initWithNibName:@"FullArticleViewController" bundle:...

 
 
1 hour later…
8:12 PM
Back!
Ahhh okay I'll try that :) Hold on (just looking at your edits)
Oh my gawd so close LOL. Okay so cellImageLink is no longer null. It gives me the file name of the image, but the entire url isn't included so it's not showing the picture. Console says: 2014-08-23 13:17:23.607 SRApp[7772:60b] cellImageLink = who-uses-facebook.jpg
What I need cellImageLink to be is the URL: domainnamehere.com/who-uses-facebook.jpg
 
8:28 PM
@Brittany
[self.featureImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://domainnamehere.com/%@",cellImageLink]]];
or
NSString *imageUrl = [NSString stringWithFormat:@"http://domainnamehere.com/%@",cellImageLink];
[self.featureImage sd_setImageWithURL:[NSURL URLWithString:imageUrl]];
 
Ooooh damn it works lol
You are...a genius. THANK YOU
If you want to make edits to your answer I'll give it a big fat green check mark LOL. I'm totally putting your username on my Christmas list hahah
 

« first day (22 days earlier)    last day (15 days later) »