-1

Passing data between a TableviewController to A UIViewController containing a TableView inside of , The tableview delegate where set with the UIViewcontroller . the name of the articlce was passed in the Viewcontroller but not the images .

lolo j
  • 11
  • 5
  • If you log arrayofimages in viewDidLoad of the NewViewController, does it give what you expect? Does [object objectForKey:@"news_image"] return an array? – rdelmar Oct 12 '14 at 23:37
  • what do u mean @rdelmar – lolo j Oct 13 '14 at 00:20
  • I mean log arrayofimages, NSLog(@"%@",arrayofimages) in viewDidLoad of NewViewController, and see what it gives you. Also, if you log [object objectForKey:@"news_image"] (in prepareForSegue) what does it give? – rdelmar Oct 13 '14 at 00:25
  • its null in the NewViewcontroller and inside of the prepare segue @rdelmar – lolo j Oct 13 '14 at 00:29
  • How about the log of [object objectForKey:@"news_image"] (in prepareForSegue)? Also, log destination in prepareForSegue. – rdelmar Oct 13 '14 at 00:32
  • its also null @rdelmar – lolo j Oct 13 '14 at 00:32
  • And is destination also null? – rdelmar Oct 13 '14 at 00:33
  • Ok, I don't know how that's possible. destination is defined as segue.destinationViewController, and that has to return whatever you've hooked your segue to. – rdelmar Oct 13 '14 at 00:36
  • the strange thing is that the arrayofname that containts the newsname data was passed to the NewviewController – lolo j Oct 13 '14 at 00:39
  • is the same code sir nothing new but NSlog @rdelmar – lolo j Oct 13 '14 at 00:42
  • Yes, that's what I want to see, because what you're telling me makes no sense. If destination is null, the segue shouldn't have even worked, and it certainly shouldn't have passed the arrayofname properly. – rdelmar Oct 13 '14 at 00:44
  • destination.arrayofname=[object objectForKey:@"newsname"];, this line of code works – lolo j Oct 13 '14 at 00:45
  • Apparently, object either does't have a key named "news_image", or the value for this particular object is null. Are you sure object has a "news_image" key? – rdelmar Oct 13 '14 at 01:30
  • news_image is a class in parse but there is a colunm where all images are saved its call "image" – lolo j Oct 13 '14 at 01:37
  • what is that @HotLicks and also i am not passing data between Two viewcontrollers – lolo j Oct 13 '14 at 01:43
  • Then why did you say "Passing data between a TableviewController to A UIViewController"??? – Hot Licks Oct 13 '14 at 02:17
  • the viewcontroller has a tableview inside of it too can you help me please take a look at my code i really need help @HotLicks – lolo j Oct 13 '14 at 02:36
  • Your problem isn't passing the data. If destination.arrayofimages in prepareForSegue in nil, then your problem is getting the data out of your Parse object. – rdelmar Oct 13 '14 at 02:50
  • so do you think i should the name of the colunm thats contains all the images but not the class right – lolo j Oct 13 '14 at 02:56
  • I guess, but I haven't used Parse much, and I don't know how you set up your class. – rdelmar Oct 13 '14 at 02:58

1 Answers1

0

What is PFImageView *imageView=(PFImageView *)[tableView viewWithTag:1] suppose to do?

The cell you dequeued will not be in tableView, so if you want to set an image in that cell, you won't get what you want.

As a guess I think you would want PFImageView *imageView=(PFImageView *)[cell viewWithTag:1].

Jeffery Thomas
  • 42,202
  • 8
  • 92
  • 117