我正在制作一个应用程序,我正在使用苹果推送通知.当我的应用程序处于后台状态时,我可以收到通知作为横幅,但当我的应用程序处于活动状态时,我能够显示通过此代码收到通知的警报: -
(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateActive) {
NSString *cancelTitle = @"Close";
NSString *showTitle = @"Show";
NSString *message = [[userInfo valueForKey:@"aps"] valueForKey:@"alert"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Some title"
message:message
delegate:self
cancelButtonTitle:cancelTitle
otherButtonTitles:showTitle, nil];
[alertView show];
} else {
//Do stuff that you would do if the application was not active
}
}
Run Code Online (Sandbox Code Playgroud)
但我想把通知显示为横幅.我会为此做些什么?请建议.
我动态地在表格视图单元格中添加一个按钮.桌子上显示的按钮,但我无法点击它们.这是我的代码,
这是我的tableviewcell类代码:
MessageTableViewCell.h
#import <UIKit/UIKit.h>
@interface MessageTableViewCell : UITableViewCell {
{IBOutlet UIButton *chat_pic_btn;}}
@property (nonatomic, retain) UIButton *chat_pic_btn;
@end;
Run Code Online (Sandbox Code Playgroud)
MessageTableViewCell.m
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {chat_pic_btn=[[UIButton alloc]init];
[self.contentView addSubview:chat_pic_btn];}}
Run Code Online (Sandbox Code Playgroud)
MessageTable.m
-(void)customActionPressed :(id)sender
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Custom Button Pressed"
message:[NSString stringWithFormat: @"You pressed the custom button on cell"]
delegate:self cancelButtonTitle:@"Great"
otherButtonTitles:nil];
[alertView show];
}
- (UITableViewCell *)tableView:(UITableView *)myTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CellIdentifier";
MessageTableViewCell *cell = (MessageTableViewCell *)[myTableView dequeueReusableCellWithIdentifier:CellIdentifier];
if …Run Code Online (Sandbox Code Playgroud) 我在app-store上传了一个应用程序.我忘记删除其中的警报.现在我只想更新没有新版本的旧应用程序.所以请帮我这样做.
我正在制作一个基于tabBar和navigationBar的应用程序.在它上面我点击它时有一个按钮然后在UIImagePickerControllerSourceTypePhotoLibrary的帮助下我打开了图像库但是imagePicker默认后退按钮,取消按钮未显示在视图上.就像我使用UIImagePickerControllerSourceTypeCamera然后相机窗口打开但我无法看到单击按钮来捕获图像,因为它将被tabBar隐藏.所以请帮我解决这个问题.这是图像的截图.
iphone objective-c uitabbarcontroller uiimagepickercontroller ios
我正在制作一个应用程序,我从Web服务中获取HTML字符串.现在,当我在Web视图上显示这些数据然后面临一些问题,以显示数据 - 来自Web服务的HTML字符串,我得到的是
<span style=\"color:#F00\"><div align=\"left\">Highlights of latest deal<br></div></span>
Run Code Online (Sandbox Code Playgroud)
当我在Web视图上显示此数据时,输出为
<div align="left"> Highlights of latest deal<br></div>
Run Code Online (Sandbox Code Playgroud)
它们是红色的.但我希望输出像红色的"最新交易亮点".那么你能否建议如何使用这些html标签以正确的格式显示数据.
编辑: -
目前代码: -
[my_webview loadHTMLString:my_string baseURL:nil];
Run Code Online (Sandbox Code Playgroud) 我购买了一台配备Mac OS X Lion 10.7.1的Mac笔记本电脑.现在我想开发iPhone应用程序,所以我想知道哪个Xcode版本支持它有故事板设施.
ios ×5
iphone ×5
xcode ×4
objective-c ×3
app-store ×1
html ×1
osx-lion ×1
uibutton ×1
uitableview ×1
uiwebview ×1