casting - Objective Cconvert id(type) to NSNumber:Error -
i want convert id* nsnumber *
trying unsigned int shortvalue = [(nsnumber *)idobject unsignedshortvalue];
but aint compiling
cast of indirect pointer objective-c pointer 'nsnumber *' disallowed arc
any ideas how it. id* object argument method ,second argument type information of id* object inside method performing type specific methods on 1 above
id
semi-primitive type, declared in objc.h as
typedef struct objc_object { class isa; } *id;
when create id objects, don't use "*", pointers objects, don't this:
id *someobject;
the correct syntax this:
id someobject;
hope helps!
--------edit------ tried out code used:
unsigned int shortvalue = [(nsnumber *)idobject unsignedshortvalue];
and compiled fine. think error how create idobject
.
---------edit---------
here's apple doc on id
: http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/objectivec/chapters/ocobjectsclasses.html , here's 2 resources on isa
pointer: what isa mean in objective-c?, http://cocoasamurai.blogspot.com/2010/01/understanding-objective-c-runtime.html. in second link, scroll top third of article find info on isa*
. hope helps!
Comments
Post a Comment