tags:

views:

25

answers:

1

hi all i am new in the field of iphone development .... i am working on a game in which when user touches on an image then a nib file must pop up on the screen i am unable to generate that event please help how i should link the nib file to the touch event such that the file pops up on the screen.. so please provide some sample code or any kind of help

thanks in advance

A: 

I think u want to load a xib when any touches on image.

U can try to put image on

button.b1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 320, 85)];
[b1 setBackgroundImage:[UIImage imageNamed:@"image.jpg"] forState:UIControlStateNormal]; [b1 addTarget:self action:@selector(buttonPressed1:) forControlEvents: UIControlEventTouchUpInside];
[views addSubview:b1]; [b1 release];


load xib on buttonPressed1.

Arun Sharma
thanks for the reply.... see i had render the image by ........... abc =[SCGraphics loadImageFilename:@"abc.png"]; ....and.... ...set the touch event by this method..... -(void) touchesEnded:(CGPoint)touch{if(CGRectContainsPoint(CGRectMake(80, 100, abc.width, abc.height), touch)) {//now here i want to trigger that xib file here means when i click on //that image the xib file must be pops up on the screen}}