我想在Objective-c中绘制一个阴阳,但我无法弄清楚如何去做.我创建了两个连接的矩形.我无法弄清楚如何制作矩形曲线的线条,以便我可以用它们制作一个圆圈.到目前为止,这是我的代码.
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddRect(context, CGRectMake(60, 150, 80, 10));
CGContextStrokePath(context);
CGContextAddRect(context, CGRectMake(60, 150, 190, 10));
CGContextStrokePath(context);
Run Code Online (Sandbox Code Playgroud)
是否有更简单的方法来创建目标-c中的阴阳,或者我是朝着正确的方向?我是Objective-c和编程的新手.
我想知道是否有人可以帮助我.我正在尝试使用NSURLSessionDownloadTask在我的UIImageView中显示图片,如果我将图像URL放入我的文本字段中.
-(IBAction)go:(id)sender {
NSString* str=_urlTxt.text;
NSURL* URL = [NSURL URLWithString:str];
NSURLRequest* req = [NSURLRequest requestWithURL:url];
NSURLSession* session = [NSURLSession sharedSession];
NSURLSessionDownloadTask* downloadTask = [session downloadTaskWithRequest:request];
}
Run Code Online (Sandbox Code Playgroud)
我不知道在此后去哪里.
objective-c uiimageview ios nsurlsession nsurlsessiondownloadtask