0
我要让headerfile Rimage.h和M,我可以在任何地方使用,但我在这里有一个问题 这是我使头文件比任何地方都可以使用iPhone
Rimage.h
@class Rahul_imageplaceCordinatesViewController;
@interface Rimage : NSObject {
Rahul_imageplaceCordinatesViewController *vc;
}
-(void)addImageSubViewAtX:(CGFloat)x atY:(CGFloat)y;
@property (nonatomic,copy) Rahul_imageplaceCordinatesViewController *vc;
+(void)check1;
@end
,这是我的.m
@implementation Rimage
@synthesize vc;
/// this method let you have image with given X n Y
- (void)addImageSubViewAtX:(CGFloat)x atY:(CGFloat)y {
CGRect myImageRect1 = CGRectMake(x, y, 30.0f, 30.0f);
UIImageView *myImage1 = [[UIImageView alloc] initWithFrame:myImageRect1];
[myImage1 setImage:[UIImage imageNamed:@"status_finish.gif"]];
myImage1.tag = 1000;
myImage1.userInteractionEnabled = YES;
[self.view addSubview:myImage1];
}
现在我mainVC
我是愈伤组织
NG这样
- (void)viewDidLoad {
Rimage *hw = [[Rimage alloc] init];
//[hw check1];
[Rimage check1];
[hw addImageSubViewAtX:160.0 atY:190.0];
}
,但我不能显示图像我不知道为什么:(
所以我应该怎么做才能使用这个头文件只显示图像,以便它可以通用? – ram 2010-07-17 02:52:58
如果我这样做[vc.view addSubview:myImage1]; 那么它的运行无限 – ram 2010-07-17 04:10:00