I am having and issue with XCode 5, I can run the simulator and build the app for my Phone but when I try to build for the profile or build using command line I get compile errors. Even if my code is empty.

#import <Foundation/Foundation.h>
@interface ActivityAV : UIAlertView {
@end

#import "ActivityAV.h"
@implementation ActivityAV
@end

The error I am getting say "Cannot find interface declaration for UIAlertView, superclass of 'ActivityAV'"

Just wondering if something has changed with XCode 5 that would prevent this from being built?

This is like my 5th update for this app so it shouldn't be an issue with the code.

有帮助吗?

解决方案

Well for one thing, UIAlertView does not support subclassing. That shouldn't technically prevent it from compiling, but since you're using Apples compiler and profiler it wouldn't surprise me if they had some code in there that prevented you from doing things they don't allow. Additionally, you aren't importing the correct library that declares UIAlertView - you need to #import <UIKit/UIKit.h>. Are you importing your own headers in your .pch file? Sometimes that results in the XCode getting confused about the pch being stale and then you don't get any of its imports.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top