Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can i load a different view on same method in iphone
    primarykey
    data
    text
    <h2>First Class</h2> <pre><code>@implementation WatchViewController - (void)viewDidLoad { [super viewDidLoad];UIButton *watch1 = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; watch1.frame = CGRectMake(5.0, 10.0, 140.0, 170.0); [watch1 setBackgroundImage:[UIImage imageNamed:@"Watch1.png"] forState: UIControlStateNormal]; [watch1 addTarget:self action:@selector(WatchesPreviewButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [scr addSubview:watch1]; UIButton *watch2 = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; watch2.frame = CGRectMake(170.0, 10.0, 140.0, 170.0); [watch2 setBackgroundImage:[UIImage imageNamed:@"watch2.png"] forState: UIControlStateNormal]; [watch2 addTarget:self action:@selector(WatchesPreviewButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; [scr addSubview:watch2]; } </code></pre> <h2>Method:</h2> <pre><code>- (IBAction)WatchesPreviewButtonPressed:(id)sender { WatchPreviewViewController *watchesPreviewView = [[WatchPreviewViewController alloc] initWithNibName:@"WatchPreviewViewController" bundle:nil]; [self.navigationController pushViewController:watchesPreviewView animated:YES]; [watchesPreviewView release]; } </code></pre> <h2>Second Class:</h2> <pre><code>@implementation WatchPreviewViewController - (void)viewDidLoad { [super viewDidLoad]; UIScrollView *scr=[[UIScrollView alloc] initWithFrame:CGRectMake(0, 46, 320, 384)]; [self.view addSubview:scr]; NSArray* ds =[NSArray arrayWithObjects: [NSArray arrayWithObjects:[self getPath:@"1a"],[self getPath:@"1b"],[self getPath:@"1c"],[self getPath:@"1d"],nil], [NSArray arrayWithObjects:[self getPath:@"2a"],[self getPath:@"2b"],[self getPath:@"2c"],[self getPath:@"2d"],nil],nil]; SSView* sv =[SSView createWithFrame:CGRectMake(0, 0, 320, 380) ds:ds]; if(??????????????????) //what condition is required for watch1? { sv.curIndexPath =[NSIndexPath indexPathForRow:0 inSection:0]; [scr addSubview:sv]; } else if(?????????????????) //what condition is required watch2? { sv.curIndexPath =[NSIndexPath indexPathForRow:1 inSection:0]; [scr addSubview:sv]; } </code></pre> <p>In class one i have two images of watch and i want load next page view on the click of watch. for this i am using method <code>WatchesPreviewButtonPressed</code>. In second Class i am creating the page for loading on button click. in second class i have a scroll view inside the view. and i have array for images. i want display different image on next watch click event. any one please me, i am new in iphone development.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload