小编How*_*irl的帖子

iOS - 在联系人中添加联系人?

Heyo!有没有办法当用户点击按钮时,它可以将联系人添加或更新到实际的Apple通讯录中?一些节日的电子邮件回复包括接收者可以在其联系簿中下载和查找的"名片".

email iphone contacts uibutton ios

38
推荐指数
1
解决办法
3万
查看次数

C:计数字母,直到插入特定条目

我在C上有点生疏了.我正在学校任务,要求我创建一个程序,获取用户输入,然后打印输出.如果字符数高于50,则不打印任何内容并重新启用它们.退出不应打印计数(在本例中为4).

这是我到目前为止:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main ()
{ /*Start of main*/

printf("Type any word you'd like <= 50 characters.\nType quit to exit:\n");

char word[50];
int wordLength = 0;

    while (strcmp(word, "quit") != 0)
    {/*open of while loop (strcmp ... != 0)*/

    scanf("%s\n", word);
    wordLength = strlen(word);
    if (wordLength > 50)
        {
            printf("Try again, >= 50 characters!:\n");
            scanf("%s", word);
            wordLength = strlen(word);
        }
    printf("%d\n", wordLength);

    }/*End of while loop (strcmp... != 0)*/

return 0;
}/*End of main*/ …
Run Code Online (Sandbox Code Playgroud)

c strlen strcmp

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

Swift:将UIImage设置为背景

我在viewDidLoad()中的行抱怨没有!在以下声明中:

 view.backgroundColor = UIColor.colorWithPatternImage(UIImage(named: "background.jpg"))
Run Code Online (Sandbox Code Playgroud)

但是,当我按照建议将其更改为此时:

 view.backgroundColor = UIColor.colorWithPatternImage(UIImage(named: "background.jpg")!)
Run Code Online (Sandbox Code Playgroud)

它给出以下错误:

致命错误:在展开Optional值时意外发现nil

再次,任何帮助将不胜感激!

uiimage uicolor ios swift

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

标签 统计

ios ×2

c ×1

contacts ×1

email ×1

iphone ×1

strcmp ×1

strlen ×1

swift ×1

uibutton ×1

uicolor ×1

uiimage ×1