ios7

Static Table Cells in NIB File

主宰稳场 提交于 2019-12-20 03:43:07
问题 Is it possible to create a nib file that has a table view with custom static cells? I want to create a form-like table view with all static content, but I'm not currently using storyboards. I was able to find the content type menu in the default Storyboard of my app, but I'm using Nibs, and when I create either a UIViewController nib or a UITableViewController nib, in both cases there is no content type menu in the Attributes inspector tab. Any thoughts? 回答1: It seems like at the moment, what

How to compare SKSpriteNode textures

寵の児 提交于 2019-12-20 02:42:28
问题 I am making a game with Sprite Kit. When there is a collision I would like to retrieve the image of the SKSpriteNode that my projectile collided with to assign different point values depending on the image of the monster. I think comparing the texture property of the SKSpriteNode could work. I have tried the following code, but my if statement is never called. Any suggestions? - (void)projectile:(SKSpriteNode *)projectile didCollideWithMonster:(SKSpriteNode *)monster { SKTexture *tex =

Disconnect individual peers from MCSession?

若如初见. 提交于 2019-12-20 01:48:08
问题 If I have an array of connected peers, let's say 3 (a->b, a->c, a->d) and I want to disconnect peer "c" only, what should I be doing? I've seen one response to a similar question state that you can only disconnect 'yourself' from a session: meaning that in the above scenario if I do this: [mySession disconnect]; that I all be disconnecting "a" from "b", "c" and "d" simultaneously. So the suggestion was to send a notification to the peer you want disconnected ("c") and tell it to disconnect

UIBarButtonItem setTintColor doesn't work on iOS7

我们两清 提交于 2019-12-20 01:41:39
问题 In iOS6, I used this code to make my UIBarButtonItem: UIBarButtonItem* validate = [[UIBarButtonItem alloc]initWithTitle:@"MyTitle" style:UIBarButtonItemStylePlain target:self action:@selector(actionValidate)]; [validate setTintColor:[UIColor orangeColor]]; self.navigationItem.rightBarButtonItem = validate; It works fine in iOS6 but in iOS7, the color of the button changes only when you push it.. How can I fix this? 回答1: In iOS7 you if you need to change the navigationBar buttons color, you

IOS Reachability notification in Background

眉间皱痕 提交于 2019-12-20 01:36:53
问题 I want to do some tasks as soon as user comes online even he is in background. I am using Reachability class for checking internet. But this class is not notifying me when i am at background. I know people asked this question earlier but didn't got any solutions there. If i use beginBackgroundTaskWithExpirationHandler . It gives me 3 to 4 min only, after that if network change i am not getting any notification. Please suggest me something.I think it is possible because native mail app work in

What's the best way to add a view under UINavigationBar in iOS7

二次信任 提交于 2019-12-20 01:10:53
问题 On ios7, a lot of apps (Apple Messages, Facebook Messenger, Calendar)have views appearing under the UINavigationBar, often with what seems to be standard animation. As it seems quite standard and looks a lot with a UIToolBar, I was looking for the standard way of implementing it but couldn't find anything. Is there a better way to adding a UIToolBar to the UINavigationBar? 回答1: You should follow this simple approach. Add a UIToolBar like this. UIBarButtonItem *flexiableItem = [

iOS7: How to add a fixed Search Bar like Contacts on iOS7?

懵懂的女人 提交于 2019-12-19 23:22:39
问题 After I search a lot of questions and answers, no good result. So I have to ask it here: I want to add a Search Bar below the navigation bar. This search bar should be fixed. Just like contacts on iOS7 below. Can any one help me to figure it out? 回答1: You have a view controller. It has a main view. Inside that main view is a search bar (UISearchBar) and, below that, a table view (UITableView). Your view controller is embedded in a navigation controller (UINavigationController).

Save image in asset catalog on runtime

孤街醉人 提交于 2019-12-19 19:56:27
问题 I have to download new images from backend in background process and i need to save them for use later in the app. In the other way, the original app images are in the asset catalog and when i add the new ones all images must accessed from the asset catalog. I try to add images to directory's app but when i have to load any image the app do not know to discriminate between images in asset catalog and other, and i thing this is not the best solution for this I do not know how add images to

iOS 7 Simulator Bug - NSAttributedString does not appear

馋奶兔 提交于 2019-12-19 19:05:03
问题 UPDATE: I have just encountered this issue on an actual iPhone 5 running iOS 7. Will provide more information soon. I think I have found a bug in the iOS 7 Simulator where a NSAttributedString does not appear. It would be great if someone else could test this to confirm it is a bug, then I will file a bug with Apple. The problem appears to be the combination of using NSUnderlineStyleAttributeName and NSParagraphStyleAttributeName for NSAttributedString. Here are the steps to reproduce: 1) In

iOS 7 Simulator Bug - NSAttributedString does not appear

ぐ巨炮叔叔 提交于 2019-12-19 19:04:13
问题 UPDATE: I have just encountered this issue on an actual iPhone 5 running iOS 7. Will provide more information soon. I think I have found a bug in the iOS 7 Simulator where a NSAttributedString does not appear. It would be great if someone else could test this to confirm it is a bug, then I will file a bug with Apple. The problem appears to be the combination of using NSUnderlineStyleAttributeName and NSParagraphStyleAttributeName for NSAttributedString. Here are the steps to reproduce: 1) In