Hey I have these UIView objects in a dictionary I have created as such:
- (NSArray *)createNumberOfViews:(NSInteger)number
{
NSMutableArray *viewArray = [NSMutableArray array];
for(NSInteger i = 0; i < number; i++)
{
UIView *view = [[UIView alloc] init];
// any setup you want to do would go here, e.g.:
// view.backgroundColor = [UIColor blueColor];
[viewArray addObject:view];
[view release];
}
return viewArray;
}
So now I need to access each member of this array and add them each to a superview, any ideas how i might go ahead and do this?
return [NSArray arrayWithArray:viewArray];. Otherwise you should change your method declaration to returnNSMutableArray.[[NSArray arrayWithObject:@"Hello"] isKindOfClass:[NSMutableArray class]]). His method signature is accurate and his method implementation is efficient, so there's really no need to complicate things or expose private implementation details IMO.