小编use*_*840的帖子

LLDB和GDB调试器之间的区别

可能重复:
GDB与LLDB调试器

我想详细了解LLDB和GDB调试器之间的区别.在任何地方都提到"LLDB比GDB更快,内存效率更高".我想知道它在哪种意义上更快,内存效率更高.

  1. 当我使用LLDB时,在调试区域的变量视图中,不显示该特定类或视图控制器的成员变量(计数).添加对象时,对于本地数组,对象不会显示在变量视图中,但会显示对象的数量(计数).

    示例(在变量视图中):

    arrayOfComments NSMutableArray*0x068a6700 1对象

    - > NSArray NSArray

    - > NSObject的

  2. 当我使用GDB时,在调试区域的变量视图中,将显示该特定类或视图控制器的成员变量.添加对象时,对于本地数组,对象以及计数将显示在变量视图中.

    示例(在变量视图中):

    arrayOfComments __NSArrayM*0x68d7970 1对象

    - > 0评论*0x6804940(此处显示对象)

  3. 我看到一篇文章说LLDB理解点语法.

    po self.property

    但是当我在GDB中使用它时,它甚至可以用于"po self.property.previousProperty'sProperty",但在LLDB中不起作用.那么现在LLDB如何理解点语法.

请帮忙.

谢谢.

iphone objective-c ios

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

如何向UITableViewCell添加自定义分隔符?

请稍等一下,因为这是一个很长的解释

我有一个UIViewController由a UIButton和a 组成的,UITableViewUITableViewCell用标识符加载不同类型的s,Cell1并且在按钮Cell2事件touchUpInside时加载.我正在使用故事板.

两个单元的分隔符都是自定义的.

Cell1 有一个分隔符占据单元格的整个宽度和单元格底部的1个像素高度.

Cell2有一个分隔符,它与左边和右边的单元格偏移了5个像素.

每个外侧的按钮时tableView被点击的tableViewCells的交换,基于所述小区标识符.

最初tableView占据Cell1 的完整宽度viewController并由tableViewCellCell1 组成,但是按钮被轻敲,s被更改为Cell2并且框架tableView被更改,宽度减少10并且x原点增加5.

但是当发生这种情况时,分隔符与Cell2右边的单元格相距5个像素,但是在左边则偏离5个像素.对于Cell2加载了数据的所有数据都会发生这种情况,而没有数据框架的单元格会被适当地更改.

但之后的单元格宽度Cell1(宽度更大)

-(void)setSeperatorStyleForTableView :(UITableViewCell *)cell //this is called in cellForRowAtIndex 
{
   //cell- type of cell(Cell1 or Cell2)

     CGRect seperatorFrame;
    UIImageView *seperatorImage;

    seperatorFrame = [self setSeperatorFrame:cell];

    if(firstCellToBeLoaded)//BOOL used to change the button text and load appropriate …
Run Code Online (Sandbox Code Playgroud)

objective-c ios

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

为什么应用程序没有在iOS 8中注册推送通知?

我将我的Xcode升级到Xcode 6.0.1,现在iOS 8设备没有进行远程通知注册.它适用于iOS 7设备.

我在app delegate中添加了代码,如下所述:

    //-- Set Notification
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
    UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:(UIRemoteNotificationTypeBadge
     |UIRemoteNotificationTypeSound|UIRemoteNotificationTypeAlert) categories:nil];
    [[UIApplication sharedApplication] registerUserNotificationSettings:settings];

    NSLog(@"current notifications : %@", [[UIApplication sharedApplication] currentUserNotificationSettings]);
}
else
{
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}
Run Code Online (Sandbox Code Playgroud)

即使是当前的通知也存在,并且它不是零.

然而,以下方法未被调用:

- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
Run Code Online (Sandbox Code Playgroud)

下面的屏幕截图说明我在后台模式中启用了某些选项:

在此输入图像描述

并且通知在我的应用的设备设置中设置.

iphone objective-c apple-push-notifications xcode6 ios8

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