ios7

Adding background for window is not working

北城余情 提交于 2019-12-13 06:18:31
问题 I have this code which run very well on XCode 4 / iOS 6 to add background image on window : - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bgleft"]]; return YES; } but today, when I try to put it into XCode 5 and try to build an app for iOS 7, it's not working anymore. is there something changed from XCode 4 to XCode 5? thank you. 回答1: Try adding a

detect if a combination of string objects from an array matches against any commands

倖福魔咒の 提交于 2019-12-13 06:02:37
问题 Please be patient and read my current scenario. My question is below. My application takes in speech input and is successfully able to group words that match together to form either one word or a group of words - called phrases; be it a name , an action , a pet , or a time frame. I have a master list of the phrases that are allowed and are stored in their respective arrays. So I have the following arrays validNamesArray , validActionsArray , validPetsArray , and a validTimeFramesArray . A new

Why would app try to save to PLSharedManagedObjectContext?

▼魔方 西西 提交于 2019-12-13 05:29:18
问题 The following is a crash report I received from my crash reporting service, HockeyApp. The reason for the failure is a failure to save in PLSharedManagedObjectContext. I (think) I am doing all of my saves in the main app delegate managedObjectContext. Why is the PLSharedManagedObjectContext the one being saved to? I think this is the relevant code: -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { __ENTERING_METHOD__ DLog(@

Memory Leak in Objective C function with ARC

耗尽温柔 提交于 2019-12-13 05:17:21
问题 here is the function from the library MGSpotyViewController, but I am asking what to watch out in this kind of situations. I am used to C++ and maintaining my own objects but I can't find the problem here. I tried very basic pieces of codes with UIGraphicsBeginImageContextWithOptions and memory still increased slightly but I wasn't sure if I located the problem or that's because the GC hasn't run yet. To test the following function I did: - (BOOL)application:(UIApplication *)application

Storyboard ui elements don't appear in Xcode 5

北城以北 提交于 2019-12-13 05:16:18
问题 I have transitioned my iPad application from iOS 6 to iOS 7 and I had to turn off auto layout or the whole application would crash when I selected to view the storyboard. Now that I can view it, all the uielements don't appear in the each storyboard screen. The screens are there but they are blank (white). The editor shows that they are there but I cannot view them at all. 回答1: Try changing the width and height/ x and y coordinate of the views. That fixed the same problem for me. 来源: https:/

How to clear the Invalid CGContext error in ios 7.

非 Y 不嫁゛ 提交于 2019-12-13 05:11:00
问题 I am doing one application.In that i got the error like below in ios 7. <Error>: CGContextSetFillColorWithColor: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update. CGContextSetStrokeColorWithColor: invalid context 0x0. This is a serious

Drawing an infinite sine wave

我与影子孤独终老i 提交于 2019-12-13 05:05:22
问题 I'm trying to make an animated sine wave similar to this solution: https://stackoverflow.com/a/17535290 I'm trying to make my sine wave continuous so that I'm constantly drawing the same sine wave. In the solution above, once the starting point of the wave is equal to the width of the frame, the view restarts drawing a new wave. Can someone explain what CGAffineTransformMakeTranslation(+_self_view.frame.size.width/2, 0); does in the code below? My understanding is that it returns a matrix

Do I have to use a UIPanGestureRecognizer instead of a UISwipeGestureRecognizer if I want to track the movement?

天大地大妈咪最大 提交于 2019-12-13 04:59:04
问题 I'm trying to implement a paging interaction for one of my views. I thought I would just use UISwipeGestureRecognizers . But through trial and error as well as examination of the documentation it appears that A swipe is a discrete gesture, and thus the associated action message is sent only once per gesture. So while I could trigger the page, I wouldn't be able to hook up animation that occurred during the drag. Is my only alternative to use a UIPanGestureRecognizer and reimplement the basic

Can't get the total length of downloading file

落爺英雄遲暮 提交于 2019-12-13 04:57:32
问题 NSMutableURLRequest *objRequest =[[NSMutableURLRequest alloc]initWithURL:url1]; [objRequest setHTTPMethod:@"POST"]; [objRequest setHTTPBody:[NSData dataWithBytes:(__bridge const void *)(dict) length:[dict count]]]; NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:[NSURLRequest requestWithURL:url1] delegate:self]; [connection start]; -(void) connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ length = [response expectedContentLength];

Sprite kit, how can i randomly call a method?

百般思念 提交于 2019-12-13 04:49:01
问题 I am programming my game at the moment in sprite kit, I have 8 differnt methods and i have it set up to call a 1 method every 5 seconds, but instead of just being able to call 1 method i want it to randomly select 1 of the 8 methods and call that. Here is my current code: - (void)updateWithTimeSinceLastUpdate:(CFTimeInterval)timeSinceLast { self.lastSpawnTimeInterval += timeSinceLast; if (self.lastSpawnTimeInterval > 5) { self.lastSpawnTimeInterval = 0; [self shootPizza]; } } - (void)update: