我是iPhone开发的新手.我只是创建应用程序,如聊天application.simple我使用JSON解析方法,我通过PHP从服务器调用数据并发回给他们.所以我有一个UIButton我想在这个UIButton上设置徽章我已经通过一些编码设置徽章,如:
在viewdid加载时:*.m文件*
self.badgeFive = [[MKNumberBadgeView alloc] initWithFrame:CGRectMake(self.next7.frame.size.width - 22,-20,44,40)];
[self.next7 addSubview:self.badgeFive];
Run Code Online (Sandbox Code Playgroud)
在.h文件中:
@property (retain) MKNumberBadgeView* badgeFive;
@property (unsafe_unretained, nonatomic) IBOutlet UIButton *next7;
Run Code Online (Sandbox Code Playgroud)
在这上面的代码next7是点击event.i可以成功添加的徽章上的这个按钮,但zhcon失败移动到下一个page.i不能点击这个按钮了.在next7事件中我称之为:
-(IBAction)next7{
msgfromuserViewController *tenth = [[msgfromuserViewController alloc] initWithNibName:nil bundle:nil];
[self presentViewController:tenth animated:YES completion:NULL];
}
Run Code Online (Sandbox Code Playgroud)
所以我需要显示徽章,以及单击此按钮,并希望移动到下一页.同时徽章将显示未读消息的编号.
是否有此类应用程序的示例代码或源代码可以管理click事件以及显示未读消息的标记.我很想知道但我不明白我该如何发展?