UIButton not displayed on iPhone 5S

I’m kind of new to iOS development and development in general.

I was working on an application for time / recording, and I ran into some strange problem. On one of the view controllers of my view, I have a UITableView, with each cell being a button that leads to another view controller. It is assumed that in the first cell, the user can press UIButton to start a method that starts the countdown. When you run this method, it activates a second UIButton, which the user can click to stop the countdown. While this is happening, the UILabel on the right side of the cell shows the elapsed time.

Until now, it worked well until a few days ago. I downloaded and started using Xcode 5.1 beta 5 and started working on this application. Now UIButtons do not appear on my iPhone 5S or any of my testers that use iPhone 5S. It works on the iPhone Simulator and on real iPhone 5S, including the iPad.

I thought it was a 64-bit problem, and I looked through my code and cannot find anything that could not work on 64-bit devices. But I watched the video of the Apple developer, which says that 32-bit applications on 64-bit devices just download the 32-bit iOS libraries and run them like this. I have not yet enabled ARM-64 in my application, since so far I have not had any problems with it on any device. Has there been a change in the iOS 7.1 SDK in beta 5 that requires table views or UIButtons to be called differently on 64-bit devices? I even tried it with a 64-bit simulator, and it works fine on it too.

I have posted the appropriate code below. I am new to development and would appreciate any help.

//Set Button Properties
self.startTimeButton.frame = CGRectMake(0, 0, 100, 39);
self.startTimeButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[self.startTimeButton setTitle:@"Start Time" forState:UIControlStateNormal];
self.startTimeButton.backgroundColor = [UIColor greenColor];
[self.startTimeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self.startTimeButton setTitleColor:[UIColor blackColor] forState:UIControlStateDisabled];
[self.startTimeButton addTarget:self action:@selector(startCountingTime) forControlEvents:UIControlEventTouchUpInside];

//Set Button 2 Properties
self.stopTimerOut = [UIButton buttonWithType:UIButtonTypeRoundedRect];
self.stopTimerOut.frame = CGRectMake(100, 0, 100, 39);
[self.stopTimerOut setTitle:@"Stop Time" forState:UIControlStateNormal];
self.stopTimerOut.backgroundColor = [UIColor redColor];
[self.stopTimerOut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self.stopTimerOut addTarget:self action:@selector(stopCountingTime) forControlEvents:UIControlEventTouchUpInside];

//Set Timer Label
self.timerDisplayLabel = [[UILabel alloc] initWithFrame:CGRectMake(250, 0, 60, 40)];

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

// First Section - Time Section
if (indexPath.section == 0) {
    if (indexPath.row == 0) {
        [cell addSubview:self.startTimeButton];
        [cell addSubview:self.stopTimerOut];
        [cell addSubview:self.timerDisplayLabel];
        [cell addSubview:self.timerActivityDiscloser];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryNone;
    }

    if (indexPath.row == 1) {
        cell.textLabel.text = @"Manually Enter Time";
    }
    if (indexPath.row == 2) {
        cell.textLabel.text = @"View Time for Month";
    }
}

And here is my header file

@property (weak, nonatomic) UIButton *startTimeButton;
@property (weak, nonatomic) UIButton *stopTimerOut;
@property (strong, nonatomic) UILabel *timerDisplayLabel;

Thank you for your help.

+3
1

. :

@property (strong, nonatomic) UIButton *startTimeButton;
@property (strong, nonatomic) UIButton *stopTimerOut;
@property (strong, nonatomic) UILabel *timerDisplayLabel;

, "", "" . , - - 5 iOS 7.1 - Beta 3. , iPhone 5S.

+3

All Articles