我在我的项目中使用Parse SDK进行推送通知.我已经didFinishLaunchingWithOptions:在parse.com上添加了代码
UIUserNotificationType userNotificationTypes = (UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound);
UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:userNotificationTypes
categories:nil];
[application registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
Run Code Online (Sandbox Code Playgroud)
它的工作正常,如果设备或模拟器版本是iOS 8,但它在iOS 6.1中不起作用,并显示消息
[UIApplication registerUserNotificationSettings:]: unrecognized selector sent to instance 0x208406c0
谁能告诉我怎么解决呢?
我在Xcode中创建了一个项目,并将项目复制到另一个系统.当我在另一个系统上打开项目时,没有选择模拟器设备(仅限真实设备)的选项.我该如何解决这个问题?
我想在tableview单元格上的按钮上添加图像,这是我的代码,一切正常但是在选择图像后,它没有设置或可见imagebutton,请帮助我......
在cellForRowAtIndexpath方法中
if(indexPath.row == 0)
{
cell.userInteractionEnabled = YES;
cell.textLabel.text =@"Your Profile Photo";
imageBtn = [[UIButton alloc]initWithFrame:CGRectMake(250, 5, 35, 35)];
[imageBtn setBackgroundImage:[UIImage imageNamed:@"AFPFriendThumbnail.png"] forState:UIControlStateNormal];
[imageBtn addTarget:self
action:@selector(myAction)
forControlEvents:UIControlEventTouchUpInside];
imageView.backgroundColor = [UIColor lightGrayColor];
[cell addSubview:imageBtn];
}
Run Code Online (Sandbox Code Playgroud)
按钮上的动作
-(void)myAction
{
UIImagePickerController * picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:picker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
UIImage *image = [info valueForKey:UIImagePickerControllerOriginalImage];
[imageBtn setImage:image forState:UIControlStateSelected];
imageBtn.backgroundColor = [UIColor redColor];
[tableView_ …Run Code Online (Sandbox Code Playgroud)