|
|
#1 |
|
[HELP] Create view from code for DetailView.
Hi, i'm trying to create a view from code for DetailViewController without using storyboard. so i just need some help here i don't know how it work
![]() Code:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController *detail = [[DetailViewController alloc] init];
// change detailview background color___Changed..OK! //
detail.view.backgroundColor = [UIColor whiteColor];
// here i want make uiimage?....doesn't work! //
detail.image = UIImage imageNamed:@"cover.png"];
// here i want make UIButton ?....doesn't work///
frame = CGRectMake(10, 70, 300, 50); or UIButton something like this...
// make Descriptiontext //
...................??
[self.navigationController pushViewController:detail animated:YES];
}
- @end
Last edited by dejo; Mar 29, 2013 at 09:14 AM. Reason: Please do not destroy the context of your thread by editing your posts to simply say "Solved". |
|
|
|
0
|
|
|
#2 |
|
Your actual code would be helpful... It's difficult to help you given what you've posted won't even compile.
What is DetailViewController? What does setting its image property do? What should it do? Have you been remembering to add the UI components you create as subviews? They won't appear until you do... |
|
|
|
0
|
|
|
#3 |
|
Well, impressive! you don't know what it's DetailViewController? so when you create a push detailsView you will know what's detailviewcontroller, this is one.
two... i actually want to push different deatilview from selected row and already i did it, but when i access to detailview the background is empty and white screen because i don't use nib file or storyboard. once you see that is too difficult, suggest me to a simple method. thanks anyway. |
|
|
|
0
|
|
|
#4 |
|
I just double checked, just to be certain. There is definitely not a built in class called DetailViewController. I therefor conclude that it's a class you wrote yourself but didn't share the implementation of. Since you didn't tell us, I have to guess its a subclass of UIViewController. UIViewController doesn't have a property called image. Thus you're either not using a UIViewController as your base class, or you've created a custom property called image.
No matter how I look at this, you haven't shared enough details about what you are doing. I offered a friendly reminder about what you definitely need to be doing. Thanks for the attitude, though. I'm sure everyone online loves helping people with attitude. |
|
|
|
0
|
|
|
#5 |
|
Put all the code to configure the DetailViewController's view in its viewDidLoad or loadView method.
|
|
|
|
0
|
|
|
#6 | |
|
Quote:
__________________
2012 Mac Mini, 2.6 GHz, 16GB RAM, 1TB HDD ![]() 2.4Ghz 15" Macbook Pro ![]() 32 GB iPhone 4S : 16 GB iPod nano : 16 GB iPad 3 Nikon D60 : 18-55 mm VR : 55-200 mm VR Last edited by maflynn; Jan 30, 2013 at 11:56 AM. Reason: Removed name calling |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 01:27 AM.









2012 Mac Mini, 2.6 GHz, 16GB RAM, 1TB HDD
Linear Mode
