[objective-c]UILabelを複製する

UILabelを複製する

-(UILabel*)getCloneUILabelByUILabel:(UILabel*)label
{
    NSData *archivedData = [NSKeyedArchiver archivedDataWithRootObject:label];
    return [NSKeyedUnarchiver unarchiveObjectWithData:archivedData];
}
UILabel*cloneLabel = [self getCloneUILabelByUILabel:modelLabel];