2011-10-05 76 views
1

我的項目工作在模擬器罰款,但加入後不會建立在真實的設備:@synthesize隱藏文件頭?

@synthesize extraView=_extraView; 

看來,這條線在某種程度上隱藏文件頭。試過「清潔」 - 沒有改變。 我以前曾多次使用過@property和@synthesize,並沒有見過這樣的事情。 我打算重寫extraView處理,但是我只是出於好奇才問,如果有人遇到類似的錯誤。

平臺:

XCode 4.0.1 
4.2.1 Ipad 

文件標題:

// 
// MediaBook.h 
// Dolphin 
// 
// Created by Handymood on 11-5-22. 
// Copyright 2011 __Hanydmood__. All rights reserved. 
// 

#import <UIKit/UIKit.h> 
#import "SinglePage.h" 
#import "LayerInfo.h" 
#import "MediaBookXMLParser.h" 
#import "GlobalSet.h" 
#import "UIComponentBase.h" 
#import "IndexPageInfo.h" 
#import "IndexPage.h" 
#import "TopBar.h" 
#import "BottomBar.h" 
#import "DolphinUIWebLayer.h" 
#import "MediaBookBase.h" 
#import "ColorUtil.h" 
#import "DolphinUICategory.h" 
#import "UICategoryUnit.h" 
#import "ImageInfoBox.h" 
#import "Gallery.h" 
#import "Calendar.h" 

@class SinglePage; 
@class LayerInfo; 
@class MediaBookXMLParser; 
@class GlobalSet; 
@class UIComponentBase; 
@class IndexPageInfo; 
@class IndexPage; 
@class TopBar; 
@class BottomBar; 
@class DolphinUIWebLayer; 
@class MediaBookBase; 
@class ColorUtil; 
@class DolphinUICategory; 
@class UICategoryUnit; 

@interface MediaBook : MediaBookBase <UIScrollViewDelegate> 
{ 
    UIImageLayer *backGroundImage; 
    UIView   *bgView; 
    BottomBar  *bottomBar; 
    DolphinUIWebLayer *webLayer; 
    DolphinUICategory *categoryLayer; 

    UIActivityIndicatorView *activityIndicator; 
    UIInterfaceOrientation preOrientation; 

    NSTimer *objQueMagTimer; 

    float previous_scroll_pos; 

    BOOL bar_status_hidden; 
    float top_bar_ori_y; 
    float bottom_bar_ori_y; 

    BOOL scroll_block_signal; 

    int screen_direction;//0:vertical 1:horizontal 

    BOOL webLayerOn; 
    BOOL categoryOn; 

    BOOL changingExtraView; 
} 

@property UIInterfaceOrientation preOrientation; 
@property (nonatomic, retain) UIView *extraView; 

-(void) initWithGlobalSet:(GlobalSet *) inGlobalSet; 
-(void) initBook:(NSString *)configXmlAdd curOrientation:(UIInterfaceOrientation)interfaceOrientation; 

-(void) initBookContent; 

-(void) notificationSelector:(NSNotification *) notification; 

-(void) statusBarAnimationTrigger; 

-(void) layoutAdjustWithOrientation:(UIInterfaceOrientation)interfaceOrientation 
           orientaionType:(NSString *) inOrientationType; 

-(void) closeCategoryLayer; 

-(void) reset; 

-(void) showExtraView:(NSString *)name; 
-(void) hideExtraView; 

@end 

構建錯誤的截圖:

enter image description here

我用@property和@synthesize之前多次還沒有見過類似的情況。

+2

是那些在超類中聲明的未聲明的變量? ('MediaBookBase')'_extraView',它在超視圖中聲明還是使用生成的ivars? – mja

+0

您正在導入一個類(#import),然後說您稍後會導入該類(@class)。這似乎沒有必要。我也無法看到fit_with_screen在哪裏定義。如果您試圖修復循環依賴並失敗,Xcode將不會注意到失敗的導入。也許你應該將這些#imports移動到.m文件中,但是它們太多了,如果你真的需要很多你手上有一堆亂七八糟的東西,那就是問題所在。 – Jano

+0

感謝您的提示 - 與混亂的問題是,我們正在使用handymood.com應用程序模板爲這個項目和這些進口&@class聲明隨包:)雖然我不知道他們是否真的有必要。 – Laurynas

回答

0

添加下面的接口聲明解決了這個問題:

UIView *_extraView; 

感謝MJA的小費。