Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-08-2010, 02:20 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
nathansenior is on a distinguished road
Default TableView Help required please...

Hi there, ok I have an App which has one main view and a popover with a table view inside it listing the contents of the document directory. The main view has an image view which i want to set with the image selected from the table view.

My problem is no matter what code I use it does not seem to be sending anything back to the main view, I have placed a label view on the main view to see if it will set text in there and nothing.

I have trawled the internet for help looked over examples and tried the code from there but I still cannot get it working. things I have tried:

DetailViewController *dvcontroller = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];

dvcontroller.userPhoto = [self.data objectAtIndex:indexPath.row];

This seems to be the way to do it, but it will not work, I also tried ammedning the 2nd line to be a label and set it with a set text item and it still wont work.

Any help would be greatly appreciated... or example code I can look at

thanks
nathansenior is offline   Reply With Quote
Old 07-08-2010, 02:26 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 74
xyster is on a distinguished road
Default

You should try posting a more concrete example (code) of what you are trying to do. Your description is too vague.
xyster is offline   Reply With Quote
Old 07-08-2010, 02:30 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
nathansenior is on a distinguished road
Default

OK sorry..

code for didselectrow method:


- (void)tableViewUITableView *)tableView didSelectRowAtIndexPathNSIndexPath *)indexPath {

NSString *imageName = [self.data objectAtIndex:indexPath.row];
imna.text = imageName;

DetailViewController *dvcontroller = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
dvcontroller.userPhoto = [self.data objectAtIndex:indexPath.row];
[self.view pushViewController:dvcontroller animated:YES];
[dvcontroller.self loadimage];
[dvcontroller release];
}


The userPhoto reference is another method in the mainview controller where the imageview is located.

I have tried directly setting the imageview but that did not work either.

What code would you use in viewA to set an image in viewB ?

ta






Quote:
Originally Posted by xyster View Post
You should try posting a more concrete example (code) of what you are trying to do. Your description is too vague.
nathansenior is offline   Reply With Quote
Old 07-08-2010, 03:36 PM   #4 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Your goal/problem is not clearly stated. In the OP, it sounds like you are trying to get something from view B to happen in view A. Your second post makes it sound like you want to go from A to B.

Try again. Be as specific as possible.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 07-09-2010, 01:11 AM   #5 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 74
xyster is on a distinguished road
Default

Quote:
Originally Posted by nathansenior View Post
dvcontroller.userPhoto = [self.data objectAtIndex:indexPath.row];
Still not very clear so I'll take a wild guess. Did you mean?

Code:
dvcontroller.userPhoto.image = [self.data objectAtIndex:indexPath.row];
xyster is offline   Reply With Quote
Old 07-09-2010, 02:46 AM   #6 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 6
nathansenior is on a distinguished road
Default

Morning,

Sorry about the ramblings last night but I had been working on the problem all day so it was getting to me!

I have tried this code:

Quote:
Originally Posted by xyster View Post
Still not very clear so I'll take a wild guess. Did you mean?

Code:
dvcontroller.userPhoto.image = [self.data objectAtIndex:indexPath.row];


I have also tried different variations, but I will try and explain better.

I have a main view which loads when you start the app, in the bottom left corner I have a button which presents a popover view, inside this view I have a tableview listing the contents of the documents directory. All the table view code is in the popover.h/m files. This works great.

On the main view I have a UIImageView which I want to load the image the user selects in the table, this is what I cannot get to happen.

I have searched for examples which have this action in but I cannot find any, so any pointers in the right direction would be appreciated.

thanks
nathansenior is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 338
12 members and 326 guests
cgokey, EXOPTENDAELAX, GHuebner, guusleijsten, Mirotion22, ohmniac, Paul Slocum, PavelSea, Pudding, SLIC, Sloshmonster, Sonuye857
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,653
Threads: 94,115
Posts: 402,888
Top Poster: BrianSlick (7,990)
Welcome to our newest member, ohmniac
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:27 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0