ah. I got it. Here's what I did. this seems like the slickets or
standard way to go:

NSPoint thePoint2 = NSMakePoint(30.0,35.0);
NSValue *test = [NSValue valueWithBytes:&thePoint2 objCType:@encode(NSPoint)];
if(strcmp((const char *)[test objCType],(const char *)@encode(NSPoint))==0) {
}

On Wed, Aug 5, 2009 at 1:15 AM, aaron
smith<beingthexemplaryli...@gmail.com> wrote:
> thanks for the info. I'm trying to put it all together. help me out?
>
> I've tried a couple diff things, here's what Im trying..
>
> NSPoint thePoint2 = NSMakePoint(30.0,35.0);
> //NSValue *test = [NSValue valueWithBytes:&thePoint2 
> objCType:@encode(NSPoint)];
> NSValue *test = [NSValue valueWithPoint:thePoint2];
> if([test objCType] == @encode(NSPoint)) printf("test is an NSPoint");
>
> thanks a bunch
>
>
>
>
> On Tue, Aug 4, 2009 at 11:59 PM, Bill Bumgarner<b...@mac.com> wrote:
>> On Aug 4, 2009, at 11:38 PM, aaron smith wrote:
>>
>>> if I receive an NSValue object, how can I find out if the value it
>>> contains is a point/rect/size/ etc. I can't figure out what to compare
>>> it with, and can't figure out if the objCType is something I can use
>>> for that problem. Any ideas?
>>
>> This:
>>
>> http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/nsvalue_Class/Reference/Reference.html#//apple_ref/occ/instm/NSValue/objCType
>>
>> Implies this:
>>
>> http://developer.apple.com/documentation/Cocoa/Conceptual/NumbersandValues/Articles/Values.html#//apple_ref/doc/uid/20000174-BAJJHDEG
>>
>> Which implies this:
>>
>> http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtTypeEncodings.html
>>
>> b.bum
>>
>>
>>
>>
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to