ios7

focus on UITextField inside a UICollectionViewCell

笑着哭i 提交于 2019-12-11 19:51:30
问题 I have created a custom UICollectionViewCell that contains a UITextField inside of it which is only accessible when the cell is selected. The CollectionView has multi select enabled and the problem is that when trying to select the UITextField to type in it, the cell is deselected instead of giving the TextField focus. How do I allow focus on the UITextField inside of the CollectionViewCell without causing the cell to be deselected? Note: I've also tried adding buttons to the cell template

iphone app memory build up

妖精的绣舞 提交于 2019-12-11 19:48:56
问题 Trying to diagnose why my game is building up memory, causing it to eventually slow down to the point of unresponsiveness. Based on previously asked questions, i think i might know what's causing it, not sure though, so i will just post what i think it might be. [self performSelector:@selector(createObstacle0) withObject:nil afterDelay:1.0]; [self performSelector:@selector(score0) withObject:nil afterDelay:1]; .... -(void)createObstacle0 { int yMin = (CGRectGetMidY(self.frame)+190); int yMax

Why do I have an excessive amount of space in a UITableView section header?

感情迁移 提交于 2019-12-11 19:41:05
问题 I have used a UITableView control to show a list of customers that the user can select from. I've divided this into a number of sections, because the customers they need to select will vary from day to day — so the sections are used to divide between the days. For some reason, there's an excessive amount of whitespace being included in the section header. I don't recall this being the case with iOS 5 (which this application was originally developed with). Can anyone nudge me in the right

ios7 - Warning: Attempt to present UINavigationController on UINavigationController while a presentation is in progress

梦想的初衷 提交于 2019-12-11 19:35:36
问题 I'm getting the warning above when selecting a segue in didSelectRowAtIndexPath. This is happening on an iPad. The iPhone gives a different warning, and I'll see if a fix to this also fixes the other. I do have two segues in the method. The first works without incident. The second picks up the warning. I've looked around the net, and checked out others' solutions. nada, so I'm posting here.. Here's the code: (I'm open to better ways to write this!) -(void)tableView:(UITableView *)tableView

iOS - didSelectRowAtIndexPath causes crash in app

空扰寡人 提交于 2019-12-11 19:17:58
问题 I have a very strange problem that I don't understand. I have a UITableView which causes a crash when I click on a row. self.tableView.backgroundColor = [UIColor clearColor]; self.tableView.delegate = self; <-- If I remove this, no crash caused self.tableView.dataSource = self; The funny thing is that I have no code at all inside didSelectRowAtIndexPath , and is still crashes? The log doesn't say much, I get (lldb) but when looking a bit further, I got this from debugger. [UITableView

iOS 7 XCode 5 Storyboard Layout Example

只愿长相守 提交于 2019-12-11 19:17:26
问题 I'm trying to create a dead simple storyboard app with a layout similar to the following. I've got the list/detail view setup but I can't figure out how to link additional pages. I want the "go" page to be my start page and drive off that. Can someone help me with a dead simple example solution on how you would set this up? I'm trying to use "push" segues. 回答1: Here are different ways to create a segues: 1 - From Control To Controller: 2 - Using Connection Inspector 3 - From View Controller

iOS 7 showing different UDIDs in different applications

限于喜欢 提交于 2019-12-11 18:57:19
问题 I am using this code to get the UDID of iOS 7 device in my app +(NSString*)uniqueIDForDevice { NSString* uniqueIdentifier = nil; if( [UIDevice instancesRespondToSelector:@selector(identifierForVendor)] ) { // >=iOS 7 uniqueIdentifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; } else { //<=iOS6, Use UDID of Device CFUUIDRef uuid = CFUUIDCreate(NULL); //uniqueIdentifier = ( NSString*)CFUUIDCreateString(NULL, uuid);- for non- ARC uniqueIdentifier = ( NSString*

How long i will run a timer in background?

旧时模样 提交于 2019-12-11 18:50:04
问题 In my application i am running a timer in background for every 8 seconds to play a custom sound,it works fine ,but it get stops at later sometime,so how can i play the sound continuously in background? Currently i am using the below code to play the sound in background SystemSoundID soundID; AudioServicesCreateSystemSoundID((__bridge CFURLRef)filePath, &soundID); AudioServicesPlaySystemSound(soundID); let me know the good solution to play the sound continuously in background 回答1: Short answer

Container View Receives Touches Instead of Subview on iPad

China☆狼群 提交于 2019-12-11 18:39:24
问题 I have a problem concerning getting a UITableViewController inside of a UIView to get touches in iOS8 (it worked fine in iOS7). Here's the setup code: UITableViewController *tvc = [[UITableViewController alloc] initWithStyle:UITableViewStyleGrouped]; tvc.tableView.userInteractionEnabled = YES; tvc.tableView.frame = CGRectMake(0, 0, self.incentivesContainerView.frame.size.width, self.incentivesContainerView.frame.size.height); [self addChildViewController:tvc]; self.incentivesContainerView

Odd error when setting UIPickerview selection with appropriate date; selectRow causing error

瘦欲@ 提交于 2019-12-11 18:13:23
问题 I'm loading just 1 picker in a view, one component is months (which displays fine), the other displays the current year (as well as previous and next years); The picker displays just fine if I comment out the line to pre-select the value for the current month. Here is my code: [super viewDidLoad]; // Do any additional setup after loading the view. NSDate *date = [NSDate date]; NSCalendar *calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents