我想将我当前的项目从iOS 6转换为iOS 7.在iOS 6中我的项目工作正常,但在iOS 7中导航栏图像显示不正常.
我在iOS 6中使用了这段代码片段,
UIImage *imgNav = [UIImage imageNamed:@"navigation.png"];
self.navigationController.navigationBar.frame = CGRectMake(0, 0, 320, 44);
[self.navigationController.navigationBar setBackgroundImage:imgNav forBarMetrics:
UIBarMetricsDefault];
Run Code Online (Sandbox Code Playgroud)
如何在iOS 7中设置导航栏图像?
我想获得所有新增加的联系人标识符.
这是我的代码:
-(void)viewWillAppear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addressBookDidChange:) name:CNContactStoreDidChangeNotification object:nil];
}
-(void)addressBookDidChange:(NSNotification*)notification
{
//Handle event here...
NSDictionary *dict = notification.userInfo;
NSLog(@"Notification - %@",dict);
}
Run Code Online (Sandbox Code Playgroud)
CNNotificationSaveIdentifiersKey数组始终为空.
Notification - {
CNNotificationOriginationExternally = 1;
CNNotificationSaveIdentifiersKey = (
);
CNNotificationSourcesKey = (
);
}
Run Code Online (Sandbox Code Playgroud)