Search Results

Search found 3 results on 1 pages for 'hookjd'.

Page 1/1 | 1 

  • pushViewController causes memory leak

    - by hookjd
    The Leaks application tells me that the following function is causing a memory leak and I can't figure out why. -(void)viewGameList { GameListController *gameListViewController = [[GameListController alloc] initWithNibName:@"GameListController" bundle:nil]; gameListViewController.rootController = self; [self.navigationController pushViewController:gameListViewController animated:YES]; [gameListViewController release]; } It tells me that this line causes a 128 byte memory leak. [self.navigationController pushViewController:gameListViewController animated:YES]; Am I missing something obvious?

    Read the article

  • when is a push notification old?

    - by hookjd
    I have noted that when the iPhone OS receives a push notification, it considers that a user action to click on the action button as a "response" to the push notification for some indefinite period of time. If the user lets the push notification sit on screen for a number of seconds, or lets the phone go to sleep, the phone no longer considers the users action as a response to the push notification itself, and therefore does not launch the corresponding app. So my question is... does anyone know what the precise definition from the iPhone OS is as to how long the phone considers a push notification response to be corresponding to the push? Sorry, I can't find a great way to phrase this question, but I hope it makes sense. I'm guessing its something like 20 seconds from my testing, but I don't see this specifically documented anywhere.

    Read the article

  • returning autorelease NSString still causes memory leaks

    - by hookjd
    I have a simple function that returns an NSString after decoding it. I use it a lot throughout my application, and it appears to create a memory leak (according to "leaks" tool) every time I use it. Leaks tells me the problem is on the line where I alloc the NSString that I am going to return, even though I autorelease it. Here is the function: -(NSString *) decodeValue { NSString *newString; newString = [self stringByReplacingOccurrencesOfString:@"#" withString:@"$"]; NSData *stateData = [NSData dataWithBase64EncodedString:newString]; NSString *convertState = [[[NSString alloc] initWithData:stateData encoding:NSUTF8StringEncoding] autorelease]; return convertState; } My understanding of [autorelease] is that it should be used in exactly this way... where I want to hold onto the object just long enough to return it in my function and then let the object be autoreleased later. So I believe I can use this function through code like this without manually releasing anything: NSString *myDecodedString = [myString decodeValue]; But this process is reporting leaks and I don't understand how to change it to avoid the leaks. What am I doing wrong?

    Read the article

1