小编Kri*_*nan的帖子

在iPhone应用程序中使用NSException

我的一个朋友让我不要在iPhone应用程序中使用NSException.他给出的原因是"性能瓶颈".但我不相信它.

有人可以确认我们应该限制在iPhone App中使用NSException吗?如果您有使用NSException的最佳实践,请同时提供.

更新:

链接要求我们在应用级别使用异常处理.有人做过吗?请提供它的优点以及它可以创建的任何其他性能故障.

iphone nsexception ios

9
推荐指数
2
解决办法
8297
查看次数

在JQuery Mobile中使用复选框的树结构

是否可以在JQuery MObile中使用带有复选框的树结构.我没有在演示中找到任何东西.

我想要类似这样的图像:有没有其他方法可以实现这一目标?在此输入图像描述

treeview jquery-mobile

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

.xcdatamodeld和BadgerNew.xcdatamodel之间的区别是什么

我认为xcode 3使用后者,xcode 4使用前者.

它们可以互换吗?

xcode core-data

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

我的应用如何通过照片发送彩信?

我想从我的应用程序中撰写一条消息,我可以添加一张照片,例如:我在iPhone中输入了我的相册并打开了一张照片,我可以点击选项,然后在彩信标签上,照片将添加到一条消息中我可以把它发送给我想要的任何联系人.我想要的是,当我点击我的应用程序上的按钮时,将打开一个消息窗口,其中包含来自我在XCode中的资源的照片,我该怎么做?

iphone mms objective-c

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

在IOS中将UIView添加到另一个UIView两次会发生什么?

在iOS中将UIView添加到另一个视图两次会发生什么?我相信它不会被添加两次.有人试过吗?

uiview ios

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

WaitUntilDOne在performSelectorOnMainThread中有什么意义?

什么是意义WaitUntilDOneperformSelectorOnMainThread

以怎样的方式YESNO设置为WaitUntilDone可以对应用程序?

更新:

我的问题应该是:在什么情况下他们会有所不同?

塞尔吉奥的回答是我所期待的.

objective-c nsobject ios

8
推荐指数
2
解决办法
7046
查看次数

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

我们可以在标题中将样式设置为标题标记

我们可以在html head的header中将样式设置为title标签,如下所示.我试过它没用..

<title style="font-style:italic;"> My Title</title>
Run Code Online (Sandbox Code Playgroud)

html css title

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

如何在使用继承时获取目标C中的调用者类名?

我有一个名为BaseClass的基类.许多类派生自BaseClass,即SubClass1,SubClass2和SubClass3.

@interface  BaseClass: NSObject{
}
-(void)configure;
@end;

@implementation
-(void)configure{
NSLog(@"This needs to log from which sub class this method was called");
}
@end;
Run Code Online (Sandbox Code Playgroud)

可以通过创建子类的实例或在它们的实现中调用configure方法.

我需要知道调用此方法的子类.

这可能吗?

inheritance objective-c

7
推荐指数
2
解决办法
5759
查看次数

支持iOS 6.0中针对不同视图控制器的不同方向

我在我的应用程序中使用自定义拆分视图控制器,带有主控制器和详细控制器.

- (id)initWithMasterController:(UIViewController*)aMasterController
            detailedController:(UIViewController*)aDetailedController;
Run Code Online (Sandbox Code Playgroud)

为主控制器和细节控制器提供的控制器是UINavigationController.

作为我的应用程序的一部分,有两种可能的方向处理案例:

  1. 当在主控制器和细节控制器中使用六个控制器组合时,应用程序支持所有方向.
  2. 仅在详细信息控制器上有StudentDetailsViewController时,只能支持两种可能的方向.(景观)

当设备的方向发生变化时,iOS 6.0以下的版本会发生以下情况

  1. -shouldAutorotateToInterfaceOrientation:方法被调用.该方法的实现如下:在运行时,我将请求转发给主控制器并使用相同的调用详细说明控制器.

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {   
        BOOL res = [masterController shouldAutorotateToInterfaceOrientation:interfaceOrientation]
                   && [detailedController shouldAutorotateToInterfaceOrientation:interfaceOrientation];
        return res;
    }
    
    Run Code Online (Sandbox Code Playgroud)
  2. masterController -shouldAutorotateToInterfaceOrientation将返回TRUE.StudentViewController中方法的实现如下.

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (IS_IPAD) ? UIInterfaceOrientationIsLandscape(interfaceOrientation)
                         : UIInterfaceOrientationIsPortrait(interfaceOrientation);
    }
    
    Run Code Online (Sandbox Code Playgroud)

获取有关要更改的新方向的信息的能力有助于我决定是否应启用旋转.

使用iOS 6.0:

当设备的方向发生变化时,iOS 6.0版本会发生以下情况

  1. -shouldAutorotate调用拆分视图控制器的方法.它的实现如下

    - (BOOL)shouldAutorotate {
        BOOL res = [masterController shouldAutorotate]
                   && [detailedController shouldAutorotate];
        return res;
     }
    
    Run Code Online (Sandbox Code Playgroud)
  2. detailedController的shouldAutorotate调用navigationController.在StudentsController中实现autorotate功能:

    - (BOOL)shouldAutorotate {
        return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations {
        return (UIInterfaceOrientationMaskLandscapeLeft
                | UIInterfaceOrientationMaskLandscapeRight);
    }
    
    Run Code Online (Sandbox Code Playgroud)

但是对于iOS 6.0,我无法控制方向.即使supportedInterfaceOrientations方法被调用,当StudentsDetailsController的shouldAutorotate方法被调用,从detailsController的shouldAutorotatemethod,该shouldAutorotateMethod不服从在supportedInterfaceOrientations方法中所提到的选项.

更新:

我阅读文档和中提供了以下注释 …

objective-c uiinterfaceorientation ios6

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