putting structs in NSArray
putting structs in NSArray
- Subject: putting structs in NSArray
- From: Ben Dougall <email@hidden>
- Date: Tue, 26 Aug 2003 12:09:03 +0100
hiyer,
this works fine for an NSRange:
NSRange r = NSMakeRange(50, 5);
NSValue *v = [NSValue valueWithBytes:&r objCType:@encode(NSRange)];
[array addObject: v]; // puts encoded struct into NSMutableArray
but what about with another struct like say:
struct str {
int x;
char y;
BOOL z;
};
struct str s = {123456, '*', YES};
how can i now add s into an NSMutableArray?
thanks, ben
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.