小编Car*_*ina的帖子

如何使应用程序在iOS 6中完全正常工作以进行自动旋转?

在iOS6中,shouldAutorotateToInterfaceOrientation已弃用.我尝试使用 supportedInterfaceOrientationsshouldAutorotate 使应用程序正常工作自动旋转但失败了.

这个ViewController我不想旋转,但它不起作用.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait;
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?在此先感谢您的帮助!

uiviewcontroller autorotate ios ios6

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

为什么单线程模型用于将UI更新为主线程?

Qt医生说,

如上所述,每个程序在启动时都有一个线程.该线程称为"主线程"(在Qt应用程序中也称为"GUI线程").Qt GUI必须在此线程中运行.

Android文档说,

与活动和其他组件一样,服务在应用程序进程的主线程中运行

和iOS,

强烈建议不要从后台线程(例如计时器,通信等)更新UI控件等.这可能是崩溃的原因,有时很难识别.而是使用这些来强制在UI线程上执行代码(它始终是"主"线程).

为什么他们使用单线程模型来更新UI?

qt android frameworks ui-thread ios

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

如何在3G网络上处理purgeIdleCellConnections?

我在我的项目中添加了第三方SDK,使用慢速3G网络时出现了purgeIdleCellConnections错误.

purgeIdleCellConnections: found one to purge conn = 0x1f55b300
Run Code Online (Sandbox Code Playgroud)

在wifi网络上没有问题,因为它不使用蜂窝网络进行图像下载.

我必须确定网络类型是wifi还是3G:

+ (BOOL) IsEnableWIFI {
    return ([[Reachability reachabilityForLocalWiFi]
             currentReachabilityStatus] != NotReachable);
}

+ (BOOL) IsEnable3G {
    return ([[Reachability reachabilityForInternetConnection]
             currentReachabilityStatus] != NotReachable);
}
Run Code Online (Sandbox Code Playgroud)

但我认为这不是一个好主意.怎么处理呢?

谢谢你的回复.

iphone networking 3g ios

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

CoreTelephony 崩溃的原因:收到没有通知名称的通知

我每天收到大约 5,000 个报告的问题,原因是“收到没有通知名称的通知”。

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException'  reason: 'Received a notification with no notification name'

Last Exception Backtrace:
0   CoreFoundation                      0x000000018206e950 __exceptionPreprocess + 132
1   libobjc.A.dylib                     0x000000018e5741fc objc_exception_throw + 60
2   CoreFoundation                      0x000000018206e810 +[NSException raise:format:arguments:] + 116
3   Foundation                          0x0000000182ba6db4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4   CoreTelephony                       0x00000001827ca39c -[CTTelephonyNetworkInfo handleNotificationFromConnection:ofType:withInfo:] + 272
5   CoreTelephony                       0x00000001827c9784 _ServerConnectionCallback(__CTServerConnection*, __CFString const*, __CFDictionary const*, void*) + 152
6   CoreTelephony                       0x00000001827de958 ___ZNK13CTServerState21sendNotification_syncE7CTEventPK10__CFStringPK14__CFDictionary_block_invoke15 + 32
7   libdispatch.dylib                   0x000000018eb4c014 _dispatch_call_block_and_release + …
Run Code Online (Sandbox Code Playgroud)

iphone crash reachability ios core-telephony

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

如何在同一个UITextField或UITextView中保留2种不同的字体?

我想设置在同一个2种不同的字体UITextFieldUITextView.怎么做?

iphone uitextfield uitextview ios

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