将ZNstartTime中的字符串分配给args [0]的正确方法是什么?谢谢。
char *args[10];
- (void)print:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
NSString *ZNstartTime = [arguments objectAtIndex:1]; //contents is "string"
NSString *ZNlengthTime = [arguments objectAtIndex:2]; //contents is "string"
args[0] = ZNstartTime //<-- returning incompatible error
}
答案 0 :(得分:2)
NSString*
将 char*
转换为[ZNstartTime cStringUsingEncoding:ASCIIEncoding]