Your variable is for an object type, and as such must be declared as a pointer:
@property (nonatomic) UIColor * color; // Note the asterisk
"Statically allocated" in this case would mean that the memory for that object was allocated at compile-time. All objects in Obj-C, however, are allocated at runtime and accessed through pointers.
"Interface type" is kind of an overly-technical term that's meaningful to the compiler, and not terribly important here. It means that UIColor
represents the interface through which the compiler expects you to interact with the variable color
. The actual type of the object pointed to may be different (as with a class cluster like NSString
).
2. C风格字符串转换为NSString型字符串
#import <Foundation/Foundation.h>
#import "myClass.h"
int main(int argc, constchar * argv[])
{
@autoreleasepool {
// insert code here..
}
char strstr[20]={0};
NSLog(@"请输入姓名:");
scanf("%s",strstr);
NSString* temp=[NSString stringWithUTF8String:strstr];
NSLog(@"%@",temp);
return0;
}