Permalink
Browse files

few changes to topic

  • Loading branch information...
1 parent eafcd9e commit ac2ab8ac8d0130daa4b28b5591d082d72e20e7a2 @grosshei committed Nov 13, 2012
Showing with 10 additions and 4 deletions.
  1. +3 −3 Topic.h
  2. +7 −1 Topic.m
View
@@ -8,9 +8,9 @@
#import <Foundation/Foundation.h>
-@interface Topic : NSObject
-
-
+@interface Topic : NSObject {
+ NSArray *questions;
+}
@property (readonly) NSString *name;
@property (readonly) NSString *tag;
View
@@ -7,6 +7,7 @@
//
#import "Topic.h"
+#import "Question.h"
@implementation Topic
@@ -16,12 +17,17 @@ -(id)initWithName:(NSString *)newName tag:newTag{
if(self = [super init]){
name = [newName copy];
tag = [newTag copy];
+ questions = [NSArray array];
}
return self;
}
+-(void)addQuestion: (Question *)question{
+ questions = [questions arrayByAddingObject: question];
+}
+
-(NSArray *)recentQuestions{
- return [NSArray array];
+ return questions;
}
@end

0 comments on commit ac2ab8a

Please sign in to comment.