标签: ios-simulator

模拟器上的设备令牌请求没有响应

我是 iphone 技术的新手,现在我正在使用一个需要实现推送通知的应用程序。

我按照链接:

http://mobiforge.com/developing/story/programming-apple-push-notification-services#comment-7850

另外,使用了以下代码:

 NSLog(@"Registering for push notifications...");
    [[UIApplication sharedApplication]
  registerForRemoteNotificationTypes:
 (UIRemoteNotificationTypeAlert |
  UIRemoteNotificationTypeBadge | 
  UIRemoteNotificationTypeSound)];

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 
{
    NSString *str = [NSString stringWithFormat:@"Device Token=%@",deviceToken];
    NSLog(str);
}

- (void)application:(UIApplication *)app didFailToRegisterForRemoteNotificationsWithError:(NSError *)err 
{ 
    NSString *str = [NSString stringWithFormat: @"Error: %@", err];
    NSLog(str);    
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 
{
    for (id key in userInfo) 
 {
        NSLog(@"key: %@, value: %@", key, [userInfo objectForKey:key]);
    }    
}
Run Code Online (Sandbox Code Playgroud)

事情是,当我运行程序时,我应该根据代码在调试器窗口中获取设备令牌,而不是我收到如下错误:

" 注册错误。错误:Error Domain=NSCocoaErrorDomain Code=3010 "模拟器不支持远程通知" UserInfo=0x6e055a0 {NSLocalizedDescription=模拟器不支持远程通知} "

我应该如何解决这个问题?

请帮帮我。 …

push-notification apple-push-notifications ios ios-simulator

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

iOS 版 Swift 与 Mac 版 Swift 相同吗?

我想知道 Swift 是否适用于 Mac 和 iOS。

如果不相同,主要区别是什么?

Swift iOS 开发人员可以在不重新学习的情况下开发 Mac 应用程序吗?

谢谢!

macos xcode ios ios-simulator swift

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

如何将图像放在appcelerator中的单个列中

我在appcelerator中有以下简单代码.我试图将2张图像放在另一张下面.其实我有10个 - 我正在努力做到

image
newline
image
newline
image
Run Code Online (Sandbox Code Playgroud)
  • Appcelerator Studio,版本:4.5.0.201602170821
  • SDK 5.2.0

var win1 = Titanium.UI.createWindow({  
    backgroundColor:"yellow"
});

var imga = Titanium.UI.createImageView ({
    image: "/png/a.png",
    top: "10px",
    });

var imgb = Titanium.UI.createImageView ({
    image: "/png/b.png",
    top: "20px",

    });

win1.add(imga); 
win1.add(imgb); 
win1.open () ;
Run Code Online (Sandbox Code Playgroud)

当我在ipad模式下运行时,图像在彼此之上.如何将它们放在单个文件列中?

谢谢

appcelerator ios ios-simulator appcelerator-titanium

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

Xcode 8.2.1中的iPhone模拟器运行有点慢

我注意到,当我启动Xcode 8 iPhone模拟器时,使用该模拟器时所执行的操作非常慢,例如,当我通过单击“硬件”>“主页”或Shift + cmd + H操纵到主屏幕时,它运行正常,但当我打开应用程序时,边框会产生奇怪的动画,而当我点击应用程序上的按钮时,过渡会花费很长时间。对不起或这么长的问题,但任何帮助将不胜感激

ios-simulator xcode8.2

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

locationManager didEnterRegion未在XCode 9 Simulator中调用

我有一个做地理围栏的应用程序.当我在模拟器(Xcode 8.3.3和Xcode 9)中运行它时,一切似乎都有效,但我的CLLocationManager didEnterRegion永远不会被调用.

当我在iPhone上运行应用程序时,无论是在现实世界中(进入某个区域)还是在Xcode中通过位置模拟运行,它都被称为正常.

知道为什么会这样吗?

我发现的一个区别是模拟器在使用时只支持监控位置,所以我必须设置好所以我的plist文件中有两个权限字符串,但除此之外我感到难过.

由于我不提供代码(它太复杂并且在我的应用程序中分发),让我注意一下模拟器中的工作原理:

  1. 在我的应用程序方案中,我选中了"允许位置模拟",并且我已经为我正在监控的位置添加了几个.gpx文件.我有一个默认的位置设置.

  2. 我启动时会调用我的位置管理器代理.我得到了.在模拟器中使用了授权者,然后在电话上使用了.

  3. 当位置发生变化时,将调用locationManager(:didUpdateLocations :).

  4. 当调用didUpdateLocations时,我会执行以下操作:

    for r in manager.monitoredRegions { 
        if let cr = r as? CLCircularRegion {
            if cr.contains(location.coordinate) {
                log.debug("Am in the region!")
            } else {
                let crLoc = CLLocation(latitude: cr.center.latitude,
                                      longitude: cr.center.longitude)
                log.debug("distance is: \(location.distance(from: crLoc))")
            }
    }
    
    Run Code Online (Sandbox Code Playgroud)

    它的工作原理.所以我的地区受到监控,我的位置就是我认为应该的位置.

  5. 最后,没有调用我的locationManager委托的monitoringDidFailFor和didFailWithError.并非他们从来没有 - 他们在开发过程中,但现在不是.

所以我很难过.再次,它在手机上工作正常,而不是在模拟器中.

我究竟做错了什么?

xcode cllocationmanager ios ios-simulator swift

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

如何在Xcode 9中重置模拟器?

在Xcode 9中重置模拟器的选项在哪里?我无法找到该选项.

xcode ios-simulator

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

iPhone 模拟器在 Xcode 中不可见

我最近将我的 Xcode 从 9.2 更新到 9.3。但不幸的是,所有 iPhone 模拟器都不再可见。

截屏

我该如何解决这个问题?

xcode cocoa-touch simulator ios ios-simulator

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

Expo 分离应用,为 Facebook App Review 生成 iOS 模拟器构建

如何在“EXBuildConstants.plist”中为 developmentURL 设置publishURL,因为localhost URL 不适用于facebbok 应用程序审查过程?

我正在构建 Expo 独立应用程序,但我需要为 Facebook 应用程序审查生成模拟器构建。

每次“EXBuildConstants.plist”都会自动更新,所以我的模拟器构建在不运行 Expo 的情况下无法工作。

detach ios-simulator react-native expo

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

试图在swift中检测iphone x总是返回false

我正在使用模拟器在iphone x上测试我的全部我已经搜索了能够检测到iPhone x的方法但是所有这些都返回false

这是他们的一种方法

struct Device {
        // iDevice detection code
        static let IS_IPAD             = UIDevice.current.userInterfaceIdiom == .pad
        static let IS_IPHONE           = UIDevice.current.userInterfaceIdiom == .phone
        static let IS_RETINA           = UIScreen.main.scale >= 2.0

        static let SCREEN_WIDTH        = Int(UIScreen.main.bounds.size.width)
        static let SCREEN_HEIGHT       = Int(UIScreen.main.bounds.size.height)
        static let SCREEN_MAX_LENGTH   = Int( max(SCREEN_WIDTH, SCREEN_HEIGHT) )
        static let SCREEN_MIN_LENGTH   = Int( min(SCREEN_WIDTH, SCREEN_HEIGHT) )

        static let IS_IPHONE_4_OR_LESS = IS_IPHONE && SCREEN_MAX_LENGTH  < 568
        static let IS_IPHONE_5         = IS_IPHONE && SCREEN_MAX_LENGTH == 568
        static let IS_IPHONE_6         = …
Run Code Online (Sandbox Code Playgroud)

xcode ios ios-simulator swift iphone-x

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

Xcode 10.1模拟器突然响应非常缓慢

我一直在开发核心Animation App(Swift),直到昨天Simulator的响应完美。突然,《模拟器》中的每个动画都开始显示极慢。这使我很难在模拟器上测试我的更改。
-Xcode 10.1-
模拟器iPhone 8 Plus 12.1

请帮忙解决这个问题

macos xcode ios ios-simulator

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