IOS9, xcode7.2, objective-c , iPod touch の初心者です。
描画用のクラスを作るのではなく、ViewController.m 内での、線描画を
試みています。
mainstoryboard 上に、 ImageView (320 x 568 point )を配置し、その上に線を描こうとして
ViewController.h 内に下記のようにしてみました。
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
// ViewController.h
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <Foundation/Foundation.h>
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
#import "TestDraw.h"
@interface ViewController : UIViewController <MFMailComposeViewControllerDelegate>
@property (weak, nonatomic) IBOutlet UIImageView *Image_View;
@end
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
また、 ViewController.m 内には
- (void)viewDidLoad
{
[super viewDidLoad];
UIGraphicsBeginImageContext(_Image_View.frame.size); CGContextRef context = UIGraphicsGetCurrentContext(); // コンテキストを取得 CGContextMoveToPoint(context, 30, 30); // 始点 CGContextAddLineToPoint(context, 100, 100); // 終点 CGContextStrokePath(context); // 描画
としましたが、 画面上には、何も表示されません。
この時点でエラーは出ていませんが、何が足りないのか、ご教示頂けたら
幸いです。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/04/03 03:51