Kevin McNeish Blog

All things iOS, Kindle and .NET

Recent Posts

Tags

News

  • First books in my new book series, "iOS App Development for Non-Programmers" are now available! iBookStore: http://itunes.apple.com/us/book/book-1-diving-in-ios-app-development/id558788074?mt=11 Amazon: http://www.amazon.com/dp/B0097N8XBE Amazon: http://www.amazon.com/dp/B0099RQGMQ

Community

Email Notifications

Archives

Understanding iOS Compiler Errors - Interface type cannot be statically allocated

0 0 1 47 269 Oak Leaf Enterprises, Inc 2 1 315 14.0 Normal 0 false false false EN-US JA X-NONE

Interface type cannot be statically allocated

You usually get this error when you forget to include an asterisk before a variable name this is an object pointer:

UILabel label = [[UILabel alloc] init];

To correct this problem, just add a asterisk before the variable name:

UILabel *label = [[UILabel alloc] init];

This is a common mistake for developers coming from other languages such as C# or Java.

 

 

For explanations of other compiler errors and warnings, check out our new book site: http://www.iOSAppsForEveryone.com

 

Kevin McNeish
Eight-time .NET MVP Recipient
Apple iOS Author, Trainer
http://www.iOSAppsForEveryone.com 

 

 

 

 

 

Leave a Comment

(required) 

(required) 

(optional)
 

(required) 

If you can't read this number refresh your screen
Enter the numbers above: