ボタン付きのUIViewControllerを作成します。ボタンの唯一の仕事は、いくつかの長方形を描画するためのウィンドウを作成することです。(私はAppleのサンプルアプリケーションの「QuartzDemo」からいくつかのコードを取りました。)ObjectiveCは本当に私にフィット感を与えています...
これを試してみると何も起こりません。
ボタンのコードは次のとおりです。
- (IBAction)startButtonAct:(id)sender
{
QuartzViewController *controller;
NSLog(@"1");
controller = [[QuartzViewController alloc] initWithTitle:@"Dotsie"];
controller.quartzViewDelegate = [[[RectDrawing alloc] init] autorelease];
[[self navigationController] pushViewController:controller animated:YES];
// [controller release];
}
正直なところ、他に何を見る必要があるのかわかりませんが、他にいくつかあります。
@interface QuartzViewController : UIViewController
{
QuartzView *quartzView;
UIBarStyle barStyle;
UIStatusBarStyle statusStyle;
}
@protocol QuartzViewDelegate;
@interface QuartzView : UIView {
id<QuartzViewDelegate> delegate;
}
@property(assign) id<QuartzViewDelegate> delegate;
@end
@protocol QuartzViewDelegate<NSObject>
@required
// Draw contents into the given view, using the given context and bounds.
-(void)drawView:(QuartzView*)view inContext:(CGContextRef)context bounds:(CGRect)bounds;
@end
助けてください-これは私を夢中にさせています-私は今1週間同じ基本的な問題と戦っています...