Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to transform this NSImage code for use on iOS
- // To create the images on the view:
- NSRect imageRect = NSMakeRect(24+(i*80), ypos, 72, 96);
- NSImageView *theImageView=[[NSImageView alloc] initWithFrame:imageRect];
- [theImageView setBounds:imageRect];
- [self addSubview:theImageView];
- [theImageView setImage:[tCard image]];
- [self.imageviews addObject:theImageView];
- // To remove the images on the view:
- for (NSImageView *timageview in self.imageviews) {
- [timageview removeFromSuperview];
- }
- [self.imageviews removeAllObjects];
- //To create the image on the view
- UIImageView * theImageView = [[UIImageView alloc] initWithFrame:CGRectMake(24+(i*80), ypos, 72, 96)];
- [self addSubview:theImageView];
- [theImageView setImage:[tCard image]];
- [self.imageviews addObject:theImageView];
- // To remove the images on the view:
- for (UIImageView *timageview in self.imageviews) {
- [timageview removeFromSuperview];
- }
- [self.imageviews removeAllObjects];
- - (id)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- self.imageviews = [[NSMutableArray alloc] initWithCapacity:4];
- }
- return self;
Advertisement
Add Comment
Please, Sign In to add comment