Im probably doing something really dumb but here you go:
Quote:
typedef enum _StringType
{
Input, Received
} StringType;
@interface MyObject: NSObject
{
NSString* theString;
StringType type;
}
@property (nonatomic, readonly) NSString* theString;
@property (readonly) StringType type;
-(id) initWithString: (NSString*) aString andType: (StringType)type;
@end
@implementation MyObject
-(id) initWithString: (NSString*) aString andType: (StringType)type{
return theString;
}
@synthesize theString, type;
@end
|
Quote:
//when something new is input by the user
MyObject* obj = [[MyObject alloc] initWithString:input.text andType: Input];
[services addObject: obj];
[obj release];
|
Quote:
//when you recieve something over wifi
MyObject* obj = [[MyObject alloc] initWithString: output andType: Received ];
[services addObject: obj];
[obj release];
|
Quote:
MyObject* obj = [services objectAtIndex:indexPath.row];
if (obj.type == Received) {
//whatever
} else if (obj.type == Input) {
//whatever
}
|