Ios ViewController未使用自定义类更新UIView

Ios ViewController未使用自定义类更新UIView,ios,objective-c,uiviewcontroller,storyboard,Ios,Objective C,Uiviewcontroller,Storyboard,我不确定我的情节提要文件中的视图控制器是否正确连接到视图,但下面是设置的详细信息-我正在使用xcode 5: 一个使用自定义类CICBoostGaugeViewController的视图控制器(在identity inspector中配置)。 一个使用自定义类CICGaugeBuilder的视图(在序列图像板文件的identity inspector中配置) CICGaugeBuilder类在init方法中绘制仪表并设置仪表的属性。当我在模拟器中运行此设置时,仪表根据CICGaugeBuilde

我不确定我的
情节提要
文件中的视图控制器是否正确连接到视图,但下面是设置的详细信息-我正在使用
xcode 5

一个使用自定义类CICBoostGaugeViewController的视图控制器(在identity inspector中配置)。 一个使用自定义类CICGaugeBuilder的视图(在序列图像板文件的identity inspector中配置)

CICGaugeBuilder
类在init方法中绘制仪表并设置仪表的属性。当我在模拟器中运行此设置时,仪表根据
CICGaugeBuilder
中初始化的仪表参数正确显示。到目前为止没有问题

我的问题是,当我在视图控制器中创建
CICGaugeBuilder
类的实例并设置属性时,当我在sim卡中运行它时,它们不会显示,只应用在
CICGaugeBuilder
类中初始化的值

CICBoostGaugeViewController.h

#import <UIKit/UIKit.h>
#import "CICGaugeBuilder.h"

@class CICGaugeBuilder;

@interface CICBoostGaugeViewController : UIViewController{
    CICGaugeBuilder *boostGauge;
}

@property (nonatomic, retain) IBOutlet CICGaugeBuilder *boostGauge;


@end
这是CICGaugeBuilder类中的初始化方法:

self.minGaugeNumber = 0;
self.maxGaugeNumber = 100;
self.gaugeType = 2;
self.gaugeLabel = @"Boost/Vac";
self.incrementPerLargeTick = 10;
self.tickStartAngleDegrees = 135;
self.tickDistance = 270;
self.menuItemsFont = [UIFont fontWithName:@"Helvetica" size:14];
请注意,在模拟器中运行时,maxGaugeNumber为100。仪表绘制正确,但问题是未使用视图控制器中的对象实例。我尝试了
[self.boostGauge SetNeedsDisplay]
,但没有成功

在我的故事板文件中,视图控制器没有任何引用输出。我认为这需要连接到应用程序代理,但我不确定<代码>将视图控制器拖动到应用程序代理不允许建立连接

以下是CICAppDelegate.h文件:

#import <UIKit/UIKit.h>

@class CICBoostGaugeViewController;

@interface CICAppDelegate : UIResponder <UIApplicationDelegate>{
    UIWindow *window;
    CICBoostGaugeViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet CICBoostGaugeViewController *viewController;

@end
#导入
@CICBoostGaugeViewer类控制器;
@接口CICAppDelegate:UIResponder{
UIWindow*窗口;
CICBoostGaugeViewController*视图控制器;
}
@属性(非原子,保留)IBUIWindow*window;
@属性(非原子,保留)IBMOutlet CICBoostGaugeViewController*viewController;
@结束

当我浏览你的应用程序时,我发现

调用
[self.boostGauge SetNeedsDisplay]
后不会产生任何效果,因为:
SetNeedsDisplay
调用
CICGaugeBuilder类的
-(void)drawRect:(CGRect)rect
方法

在这里,再次调用initialize方法和initialise方法将再次将值设置为初始值。 最终没有效果

最重要的是,您可以使用

CICAppDelegate *ap=(CICAppDelegate *)[[UIApplication sharedApplication]delegate];

    ap.guage.value=50;
在appDel中获取
CICGaugeBuilder类
的对象引用

将以下内容添加到
initialiseGuageMethod

  CICAppDelegate *ap=(CICAppDelegate *)[[UIApplication sharedApplication]delegate];
    ap.guage=self;
CICAppDelegate *ap=(CICAppDelegate *)[[UIApplication sharedApplication]delegate];

    ap.guage.value=50;
  CICAppDelegate *ap=(CICAppDelegate *)[[UIApplication sharedApplication]delegate];
    ap.guage=self;