小编mar*_*101的帖子

isRegisteredForRemoteNotifications始终返回no

我得到了弹出窗口,我接受了,我在通知中看到它并且它已打开但是这段代码总是返回否,我似乎无法找出原因

UIApplication *application = [UIApplication sharedApplication];

BOOL enabled;

// Try to use the newer isRegisteredForRemoteNotifications otherwise use the enabledRemoteNotificationTypes.
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{

    enabled = [application isRegisteredForRemoteNotifications];
}
else
{
    UIRemoteNotificationType types = [application enabledRemoteNotificationTypes];
    enabled = types & UIRemoteNotificationTypeAlert;

}
if  (enabled){
    NSLog(@"is registered");
}else{
     NSLog(@"is not registered");
}
Run Code Online (Sandbox Code Playgroud)

iphone xcode objective-c apple-push-notifications ios8

6
推荐指数
2
解决办法
5554
查看次数

使用AutoLayout将UITextView扩展到指定高度后重新启用它

我知道有一些类似的帖子,但它们似乎对我不起作用.

我有一个uitextview,我想表现得类似于messenging应用程序.

我使用autolayouts和[textview setScrollEnabled:NO]来允许uitextview在键盘上方动态扩展.当然,它会一直延伸到屏幕顶部.当它停止增长时,你无法看到任何其他文字.

我试图找到它在textViewDidChange内停止增长的高度并调用[textView setScrollEnabled:YES],但它在缩小之前缩小了初始大小.

如何在滚动到达某个高度或不再生长时启用滚动?

objective-c uitextview xcode6 ios8 ios-autolayout

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

使用动画将uitableview单元格移动到顶部

简单,我是新手!

所以我有一个uitableview,其中包含可以从Web服务更改的每个单元格中的内容.

我需要在视觉上显示任何单元格中的某些内容发生变化.因此,我希望在该单元格的内容发生变化时将特定单元格移动到顶部...动画!

这可能吗??怎么做呢?

objective-c uitableview ios xcode5

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