小编bas*_*ste的帖子

添加UIGestureRecognizer从左到右向左滑动以查看我的视图

我有一个不同的UIStoryboard UIViewControllers,我想添加另一个UIViewController(如仪表板),当用户从左侧滑动ipad时,仪表板会出现,然后当他向后滑动时,当前视图将被恢复.

这可能吗?如果是的话有什么提示怎么做或任何好的教程UIGestureRecognizer

谢谢.

objective-c uiviewcontroller uigesturerecognizer ios swipe-gesture

41
推荐指数
1
解决办法
5万
查看次数

如何按降序对日期数组进行排序

我有一个解析为数组的NSDictionary,其中一个元素是date,我尝试使用[startimeArray sortUsingSelector:@selector(compare:)];(starttimeArray)是我的日期,但它只安排升序.我怎样才能按降序排序.谢谢

objective-c nsdictionary nsdate uitableview ios

15
推荐指数
2
解决办法
3万
查看次数

如何从两个有两页的UIViews创建一个pdf

我有两个UIViews需要转换为PDF并作为附件发送.我的代码与第一个代码重叠UIView.我想将此作为电子邮件的附件发送.

谢谢.

NSMutableData *pdfData=[NSMutableData data];


UIGraphicsBeginPDFContextToData(pdfData,aView.bounds, nil);
CGContextRef pdfContext=UIGraphicsGetCurrentContext();

UIGraphicsBeginPDFPage();
[aView.layer renderInContext:pdfContext];
 UIGraphicsEndPDFContext();


UIGraphicsBeginPDFContextToData(pdfData, bView.bounds, nil);

CGContextRef pdfContext2=UIGraphicsGetCurrentContext();
UIGraphicsBeginPDFPage();

[bView.layer renderInContext:pdfContext2];
  UIGraphicsEndPDFContext();



MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
NSString *subject=[NSString stringWithFormat:@"Delivery Report-%@",[globUserID uppercaseString]];
[mailer setSubject:subject];
[mailer addAttachmentData:pdfData mimeType:@"pdf" fileName:@"DeliveryReport.pdf"];
[self presentModalViewController:mailer animated:YES];
Run Code Online (Sandbox Code Playgroud)

pdf objective-c uiview ios

4
推荐指数
1
解决办法
4078
查看次数

添加双引号到NSString附加到变量

可能重复:
如何使用双引号将NSString初始化为文本

如何在NSString中的变量中添加tan实际双引号以在NSDictionary中使用?例

NSString *ename=@"John Doe";
NSDictionary *profile=@{@"Profile":@{"Name":ename}};
Run Code Online (Sandbox Code Playgroud)

我需要显示如下"个人资料":{"姓名":"John Doe"}

objective-c nsdictionary nsstring ios

0
推荐指数
2
解决办法
3221
查看次数