Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Created January 3, 2013 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonycvella/4446417 to your computer and use it in GitHub Desktop.
Save anthonycvella/4446417 to your computer and use it in GitHub Desktop.
//
// ItemDatabase.h
// WarZ Companion
//
// Created by Anthony on 1/3/13.
// Copyright (c) 2013 Anthony. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface ItemDatabase : NSObject {
NSString *category;
NSString *name;
}
@property (nonatomic, copy) NSString *category;
@property (nonatomic, copy) NSString *name;
+ (id)itemOfCategory:(NSString*)category name:(NSString*)name;
@end
//
// ItemDatabase.m
// WarZ Companion
//
// Created by Anthony on 1/3/13.
// Copyright (c) 2013 Anthony. All rights reserved.
//
#import "ItemDatabase.h"
@implementation ItemDatabase
@synthesize category, name;
+ (id)itemOfCategory:(NSString *)category name:(NSString *)name
{
ItemDatabase *newItem = [[self alloc] init];
[newItem setCategory:category];
[newItem setName:name];
return newItem;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment