William Bowling is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

wbowling / adium (fork of adium / adium)

Fork of Adium for patches/improvements

Clone this repository (size: 338.7 MB): HTTPS / SSH
hg clone https://bitbucket.org/wbowling/adium
hg clone ssh://hg@bitbucket.org/wbowling/adium

adium / Source / AICalendarDate.m

//
//  AICalendarDate.m
//  Adium
//
//  Created by Evan Schoenberg on 7/31/06.
//

#import "AICalendarDate.h"


@implementation AICalendarDate
/*!
 * @brief Initialize with coder
 */
- (id)initWithCoder:(NSCoder *)decoder
{
        if ((self = [super initWithCoder:decoder])) {
                if ([decoder allowsKeyedCoding]) {
                        granularity = [[decoder decodeObjectForKey:@"Granularity"] integerValue];
                } else {
                        granularity = [[decoder decodeObject] integerValue];                    
                }
        }
        
        return self;
}

- (void)encodeWithCoder:(NSCoder *)encoder
{
        [super encodeWithCoder:encoder];

        if ([encoder allowsKeyedCoding]) {
        [encoder encodeObject:[NSNumber numberWithInteger:granularity] forKey:@"Granularity"];
                
    } else {
        [encoder encodeObject:[NSNumber numberWithInteger:granularity]];
    }
}

- (id)copyWithZone:(NSZone *)inZone
{
        AICalendarDate *newDate = [super copyWithZone:inZone];
        newDate->granularity = granularity;

        return newDate;
}

- (void)setGranularity:(AICalendarDateGranularity)inGranularity
{
        granularity = inGranularity;
}
- (AICalendarDateGranularity)granularity
{
        return granularity;
}
@end