错误:语义问题:接口类型无法静态分配?

ane*_*yzm 21 ipad ios

什么"error: Semantic Issue: Interface type cannot be statically allocated"意思?

这是错误的路线:

UIViewController imageWithCaptionController = [[UIViewController alloc] initWithNibName:@"ImageWIthCaption" bundle:nibBundleOrNil];
Run Code Online (Sandbox Code Playgroud)

谢谢帕特里克

Vla*_*mir 42

你可能在imageWithCaptionController之前缺少'*',你的线应该是

UIViewController *imageWithCaptionController = ...
Run Code Online (Sandbox Code Playgroud)

  • 这只解释了如何修复错误.OP询问错误*的含义*.[这个答案](http://stackoverflow.com/a/8460375/172218)给出了更完整的解释. (4认同)