小编Mar*_*kus的帖子

XCode 6 MFMailComposeViewController不起作用

我尝试将我的应用程序升级到iOS 8.应用程序在iOS 7和iOS 6(在我的iPhone和iPad中)运行完美.

但在iOS 8 NOT(iPhone 6模拟器).

而不是iPhone 5模拟器和任何iPhone模拟器(Xcode 6.0)

我只是尝试发送邮件.

MFMailComposeViewController *mailComp = [[MFMailComposeViewController alloc]init];

[mailComp setMailComposeDelegate:self];

    if ([MFMailComposeViewController canSendMail]) {

        [mailComp setSubject:@"Subject test"];

        [mailComp setMessageBody:@"Message body test" isHTML:NO];

        [self presentViewController:mailComp animated:YES completion:nil];
    }

- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {

    if (error) {
        // Error handling 
    }
[self dismissViewControllerAnimated:NO completion:nil];
}
Run Code Online (Sandbox Code Playgroud)

错误消息:

不是有效的电子邮件地址.

ViewServiceDidTerminateWithError:Error Domain = _UIViewServiceInterfaceErrorDomain Code = 3"无法完成操作.

{Message =服务连接中断}

我观察到在iPhone 6模拟器中你无法创建一个GMail帐户,但我创建了一个iCloud邮件帐户(我认为是新功能)

我不知道这是不是问题.拜托,在这种情况下有人吗?

xcode6 ios8

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

Xcode 6 NSUserDefaults不起作用

Xcode 6中:NSUserDefaults设备模拟器(iPhone 5,iPhone 6等,模拟器)中不起作用.

如果您在真实设备上进行测试,它可以完美运行.有人知道如何将此信息发送给Apple?我曾尝试联系Apple,但我没有收到答复.

我无法在真正的iPhone6或iPhone6 Plus上进行测试,因为在我的国家还没有.

我的代码(是一个例子)在设备上运行良好:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

NSString *appTheme = [defaults objectForKey:@"theme_preference"];

if ([appTheme isEqualToString:@"color0"]) {

} else {

}
Run Code Online (Sandbox Code Playgroud)

可能,我没有表达清楚.

用户在"iPhone o iPad设置"中必须更改应用程序的设置参数.

设置由"Settings.bundle"的"Root.plist"实现.

也就是说,我尝试测试用户更改应用程序的参数.但在源代码中我没有看到这些变化.我总是谈论设备模拟器(Xcode6)

应用设置

nsuserdefaults xcode6 ios8

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

由于属性“imageView”为“弱”,实例将立即被释放

我正在尝试将我的应用程序更新到 Xcode 10 (iOS 12),编辑器向我显示了很多这样的警告消息:

由于属性“imageView”为“弱”,实例将立即被释放

所有这些警告(我有很多,真的,真的很多)都出现在 UIImageView 出口中。

@IBOutlet weak var imageView : UIImageView!

let logo = UIImage(named: "Cartoon.png")

imageView = UIImageView(image:logo)
Run Code Online (Sandbox Code Playgroud)

警告出现在此类行中:

imageView = UIImageView(image:logo)
Run Code Online (Sandbox Code Playgroud)

一些想法?

ios swift

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

标签 统计

ios8 ×2

xcode6 ×2

ios ×1

nsuserdefaults ×1

swift ×1