Monday, September 23, 2013

oc can create objects on the stack it?

If that

CGRect rect;

NSObject object;

NSArray array;

After the two lines will be reported compile errors Interface type cannot be statically allocated

Could hang with NSObject @ interface NSObject a relationship?

Why c + + can be done to create objects on the stack like? ? ?

Which sensible an explanation ah?

Reply:
http://blog.csdn.net/cocoarannie/article/details/9956281
Reply:
NSObject is objective-c object base class, objective-c object pointer declaration must be based on the way, and CGRect is a struct so you can directly declare
Reply:
Generally object on the heap, CG structure that is encapsulated, no pointer to it on

No comments:

Post a Comment