小编Sau*_*abh的帖子

如何在应用程序的活动状态下将远程推送通知显示为横幅样式?

我正在制作一个应用程序,我正在使用苹果推送通知.当我的应用程序处于后台状态时,我可以收到通知作为横幅,但当我的应用程序处于活动状态时,我能够显示通过此代码收到通知的警报: -

(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)

但我想把通知显示为横幅.我会为此做些什么?请建议.

iphone xcode objective-c push-notification ios

6
推荐指数
1
解决办法
2031
查看次数

如何在表格单元格上添加可点击按钮?

我动态地在表格视图单元格中添加一个按钮.桌子上显示的按钮,但我无法点击它们.这是我的代码,

这是我的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)

iphone xcode uibutton uitableview ios

5
推荐指数
2
解决办法
4万
查看次数

如何在没有新版本的情况下在app-store上更新应用程序?

我在app-store上传了一个应用程序.我忘记删除其中的警报.现在我只想更新没有新版本的旧应用程序.所以请帮我这样做.

iphone xcode app-store ios

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

如何在基于tabBar的应用程序中使用UIImagePickerController?

在此输入图像描述我正在制作一个基于tabBar和navigationBar的应用程序.在它上面我点击它时有一个按钮然后在UIImagePickerControllerSourceTypePhotoLibrary的帮助下我打开了图像库但是imagePicker默认后退按钮,取消按钮未显示在视图上.就像我使用UIImagePickerControllerSourceTypeCamera然后相机窗口打开但我无法看到单击按钮来捕获图像,因为它将被tabBar隐藏.所以请帮我解决这个问题.这是图像的截图.

iphone objective-c uitabbarcontroller uiimagepickercontroller ios

3
推荐指数
1
解决办法
3128
查看次数

如何在iPhone上的UIWebview上显示html字符串?

我正在制作一个应用程序,我从Web服务中获取HTML字符串.现在,当我在Web视图上显示这些数据然后面临一些问题,以显示数据 - 来自Web服务的HTML字符串,我得到的是

<span style=\"color:#F00\">&lt;div align=\"left\"&gt;Highlights of latest deal&lt;br&gt;&lt;/div&gt;</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)

html iphone objective-c uiwebview ios

3
推荐指数
1
解决办法
1万
查看次数

哪个版本的Xcode与OS X Lion 10.7.1兼容?

我购买了一台配备Mac OS X Lion 10.7.1的Mac笔记本电脑.现在我想开发iPhone应用程序,所以我想知道哪个Xcode版本支持它有故事板设施.

xcode osx-lion

0
推荐指数
1
解决办法
1万
查看次数