App Interrupted by Push Notification from another App?

Discussion in 'iOS Programming' started by ArtOfWarfare, Dec 4, 2009.

  1. ArtOfWarfare macrumors 604


    Nov 26, 2007
    Okay, this issue actually made me laugh when it came up while testing my application on my actual iPhone.

    I have a login alert for my app. It creates an alert view, gives it two text fields for name and password, gives it a button for log in and log off, and then moves the whole thing up 85 pixels and invokes the keyboard.

    Without moving the whole thing up the keyboard partially covers my alert.

    Well, I was testing this login alert view when suddenly AIM pushes a notification to my phone. Thus my alert goes away and is replaced with the notification from AIM. But here's the issue... the message was several lines long. So many lines long in fact, that the dismiss button was covered up by the keyboard, which had never been dismissed.

    So I'm just wondering, is there a method I can add for when my application is interrupted by a push notification from another app? Obviously to solve this issue I would add to that method that the keyboard needs to get dismissed.

    ... and now that I think about it, I would need another method for if they dismiss the notification. That function would have to bring the keyboard back.

    Edit: On an almost completely unrelated note (I already had the most recently created thread, I didn't want to create a second...)

    How do I get the little red - next to a table cell?

    I have:
    cell.shouldIndentWhileEditing = YES;
    cell.editing = YES;
    both right as the cells are drawn.

    Along with
    - (UITableViewCellEditingStyle)tableView: (UITableView *)tableView editingStyleForRowAtIndexPath: (NSIndexPath *)indexPath
    return UITableViewCellEditingStyleDelete;

    Swiping the cell will bring up the delete confirmation, and you can successfully delete items, but the cells neither indent nor get the little red minus buttons.

Share This Page