NickFalk
Feb 28, 2009, 05:24 PM
Phew, quite a headline. Anyway, I may be way off track here but what I am trying to achieve is to have an instance of the object "Room" output to a nib called "DungeonView.xib" (being controlled by "DungeonViewController").
Room.h
#import "Room.h"
@implementation Room
@synthesize floor;
-(void)displayRoomFloor:(id)sender
{
NSLog(@"displayRoomFloor");
floor.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"floor1.png"],[UIImage imageNamed:@"floor2.png"], nil];
floor.animationDuration = 0.2;
floor.animationRepeatCount = 0;
[floor startAnimating];
}
@end
I've added an Object to the DungeonView.xib and changed its type to "Room".
I've hooked up the Room Class' IBOutlet "floor" to a UIImageView in the DungeonView.xib
It seems to me that the problem has likely to do with where the Room object (or rather its instance) is outputting. I believe this as the animation bit works perfectly on its own when it is included directly in my DungeonViewController in the "viewDidLoad" method. I am now instead trying the following to achieve the same functionality from the instance of "Room".
DungeonViewController
-(void)viewDidLoad {
[super viewDidLoad];
room = [[[Room alloc] init] autorelease];
[room displayRoomFloor:self];
}
I also know that the method is called as the console displays the NSLog call just fine. Anyone?
Room.h
#import "Room.h"
@implementation Room
@synthesize floor;
-(void)displayRoomFloor:(id)sender
{
NSLog(@"displayRoomFloor");
floor.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"floor1.png"],[UIImage imageNamed:@"floor2.png"], nil];
floor.animationDuration = 0.2;
floor.animationRepeatCount = 0;
[floor startAnimating];
}
@end
I've added an Object to the DungeonView.xib and changed its type to "Room".
I've hooked up the Room Class' IBOutlet "floor" to a UIImageView in the DungeonView.xib
It seems to me that the problem has likely to do with where the Room object (or rather its instance) is outputting. I believe this as the animation bit works perfectly on its own when it is included directly in my DungeonViewController in the "viewDidLoad" method. I am now instead trying the following to achieve the same functionality from the instance of "Room".
DungeonViewController
-(void)viewDidLoad {
[super viewDidLoad];
room = [[[Room alloc] init] autorelease];
[room displayRoomFloor:self];
}
I also know that the method is called as the console displays the NSLog call just fine. Anyone?
