小编Lar*_*rme的帖子

如何在NSDate中添加一个月?

如何将月添加到NSDate对象?

NSDate *someDate = [NSDate Date] + 30Days.....;
Run Code Online (Sandbox Code Playgroud)

iphone objective-c nsdate ios

74
推荐指数
4
解决办法
5万
查看次数

如何在Swift中创建唯一对象列表数组

我们怎样才能创建像雨燕语言的独特对象名单NSSetNSMutableSet在Objective-C.

nsset swift

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

NSArray的大小

如何获得a的大小NSArray并在控制台中使用NSLog

arrays objective-c ios

48
推荐指数
3
解决办法
6万
查看次数

检查UIAlertController TextField以启用该按钮

我有一个带文本字段和两个按钮的AlertController:CANCEL和SAVE.这是代码:

@IBAction func addTherapy(sender: AnyObject)
{
    let addAlertView = UIAlertController(title: "New Prescription", message: "Insert a name for this prescription", preferredStyle: UIAlertControllerStyle.Alert)

    addAlertView.addAction(UIAlertAction(title: "Cancel",
                                         style: UIAlertActionStyle.Default,
                                         handler: nil))

    addAlertView.addAction(UIAlertAction(title: "Save",
                                         style: UIAlertActionStyle.Default,
                                         handler: nil))

    addAlertView.addTextFieldWithConfigurationHandler({textField in textField.placeholder = "Title"})


    self.presentViewController(addAlertView, animated: true, completion: nil)


}
Run Code Online (Sandbox Code Playgroud)

我想要做的是在文本字段为空时执行检查以禁用SAVE按钮,就像想要创建NewAlbum的iOS的图片应用程序一样.请有人能解释一下该怎么办?

alert ios swift uialertcontroller

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

应用程序因Facebook SDK和Flurry SDK中的advertisingIdentifier而被拒绝

我的应用程序因advertisingIdentifierFacebook sdk和Flurry SDK 被拒绝了!我advertisingIdentifier在最新的Facebook SDK (3.12)Flurry SDK中发现了一个问题.也许您可以使用以下方法检查您的图书馆是否出现:

我打开了FacebookSDK.framework作为终端中的库并输入以下命令

otool -v -s __TEXT __objc_methname FacebookSDK | grep advertisingIdentifier
Run Code Online (Sandbox Code Playgroud)

和Flurry SDK一样.

但我不知道该怎么做.

对于新闻:Flurry最近更新了他们的SDK,其中不包含"advertisingIdentifier",但Facebook还没有.

iphone facebook objective-c ios

23
推荐指数
2
解决办法
1万
查看次数

检测iOS应用程序进入后台

我正在研究用Swift编写的iOS游戏.我试图找到一种方法来检测应用程序何时进入后台模式或因其他原因而中断,例如电话但无法找到任何内容.我该怎么做?

iphone ios swift

22
推荐指数
5
解决办法
2万
查看次数

如何在iOS中点击缩放和双击缩小?

我正在开发一个应用程序来显示一个UIImages使用a 的画廊UIScrollView,我的问题是,如何点击zoom并双击zoom,如何处理时它是如何工作的UIScrollView.

objective-c uiscrollview ios uitapgesturerecognizer

21
推荐指数
1
解决办法
2万
查看次数

如何在iphone上的whatsapp上共享图像+文本标题(URL)?

我在WhatsApp上使用了以下代码来共享图像,但我无法使用以下代码设置标题文本.

我已尝试过注释属性UIDocumentInteractionController,但在WhatsApp开发人员表单中,没有为注释指定任何键.

我知道我们可以通过使用来实现UIImageGraphicContext,但我需要将URL作为标题共享

if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"whatsapp://app"]])
{
    NSString * savePath  = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/whatsAppTmp.wai"];

    [UIImageJPEGRepresentation([UIImage imageNamed:@"Convenor- image-SURANA1.png"], 1.0) writeToFile:savePath atomically:YES];

    _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
    _documentInteractionController.annotation = [NSDictionary dictionaryWithObject:@"wwww.google.com" forKey:@"whatsappCaption"];

    _documentInteractionController.UTI = @"net.whatsapp.image";
    _documentInteractionController.delegate = self;

    [_documentInteractionController presentOpenInMenuFromRect:CGRectMake(0, 0, 0, 0) inView:self.view animated: YES];

} else {
    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Alert." message:@"Por favor, instale Whatsapp." delegate:nil cancelButtonTitle:@"Está bem" otherButtonTitles:nil];
    [alert show];
}
Run Code Online (Sandbox Code Playgroud)

iphone ios whatsapp

14
推荐指数
1
解决办法
5063
查看次数

Swift - 无论状态如何都设置UIButton标题

在Swift中有没有办法为所有状态更改UIButton的标题/标签?我将UIButton的标题设置为某些东西,但是当它没有突出显示时,标签会改变为之前的标签.

谢谢

uibutton ios swift

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

NSDiacriticInsensitiveSearch和阿拉伯语搜索

众所周知,NSDiacriticInsensitiveSearch对阿拉伯字母的影响与对法语的影响不同.这就是为什么我试图用阿拉伯字母创造相同的效果.
例如,如果用户输入字母"ا",则搜索栏应同时显示包含字母"ا"和字母"أ"的所有单词.
使用以下行:

  text = [text stringByReplacingOccurrencesOfString:@"?" withString:@"?"];
Run Code Online (Sandbox Code Playgroud)

不会显示以"ا"开头的单词的结果.
在搜索栏中,我尝试实现与我在法国案例中所做的相同的NSDiacriticInsensitiveSearch方法,但它没有成功:

NSRange nameRange = [author.name rangeOfString:text options:NSAnchoredSearch | NSDiacriticInsensitiveSearch];
Run Code Online (Sandbox Code Playgroud)

有任何想法如何完成这项工作?

sqlite arabic uisearchbar ios7

12
推荐指数
1
解决办法
510
查看次数