2014-02-11 5 views
3

저는 일반적으로 iOS 개발 및 개발에 익숙합니다.iPhone 5S에 UIButton이 표시되지 않습니다.

나는 앱/앱을 보관하는 시간/기록 작업 중이며 이상한 문제가 발생했습니다. 내보기 컨트롤러 중 하나에서 다른보기 컨트롤러에 연결하는 단추중인 각 셀에있는 UITableView가 있습니다. 첫 번째 셀에서 사용자는 시간 계산을 시작하는 메소드를 실행하기 위해 UIButton을 누를 수 있어야합니다. 이 메서드를 실행하면 사용자가 누적 시간을 멈추게 할 수있는 두 번째 UIButton을 활성화합니다. 이것이 진행되는 동안 셀의 오른쪽에있는 UILabel은 경과 시간을 보여줍니다.

며칠 전까지는 정상적으로 작동했습니다. 나는 Xcode 5.1 베타 5를 다운로드하여 사용하기 시작했다. 이제 UIButtons는 내 iPhone 5S 나 iPhone 5S를 사용하는 테스터에 표시되지 않습니다. 그것은 아이폰 시뮬레이터와 iPad를 포함한 실제 5S가 아닌 아이폰에서 작동합니다.

아마도 64 비트 문제 였고 코드를 둘러 보았고 64 비트 장치에서 작동하지 않는 것을 찾을 수 없었습니다. 그러나 64 비트 장치에서 32 비트 앱을 실행하면 32 비트 iOS 라이브러리가로드되고이를 실행한다는 Apple Developer Video를 보았습니다. 아직 ARM-64를 내 앱에서 사용하도록 설정하지 않았습니다. 지금까지 어떤 기기에서든 문제가 없었습니다. 베타 5의 iOS 7.1 SDK에 64 비트 장치에서 tableviews 또는 UIButtons을 다르게 호출해야하는 변경 사항이 있습니까? 나는 심지어 64 비트 시뮬레이터로 시도해 보았지만 잘 작동한다.

아래 관련 코드를 입력했습니다. 나는 개발의 초보자이고 어떤 도움을 주셔서 감사합니다.

//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"; 
    } 
} 

그리고 여기 당신의 도움에 감사드립니다 내 헤더 파일

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

입니다.

+0

iOS 베타는 까다 롭습니다. 새 프로젝트로 응용 프로그램을 다시 빌드하고 베타 버전으로 새 프로젝트에서 작업을 복사 한 다음 작동하는지 또는 경고 또는 예외가 발생하는지 확인하십시오. 베타로 작업하면서 모든 꼬임이 해결되는 것은 아니라는 것을 알았습니다. 결국 그것은 베타 .. :) –

+0

나는이 정확한 문제로 인해 문제에 직면했다. 이것은 Xcode 5.1 및 iPhone 5S의 GA 버전에서 여전히 발생합니다. –

답변

3

문제의 해결책을 찾았습니다. 이 같은 헤더 파일의 속성을 변경 : 나는 그들이 이전에 "약"으로 잘 작동하고 여전히 시뮬레이터에서 일할 때 그들을 "강한"해야 할 이유

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

는 모르겠어요. 나는 이전에 베타 3으로 구축하고 있었지만, 속성을 변경하자마자 iPhone 5S 테스트 용 iPhone의 버튼을 다시 볼 수있었습니다.

+0

그게 해결되면 자신의 대답을 받아 들여야합니다. – Marco

+0

내일까지 내 대답을 받아들이지 않을 것입니다. 나는 벌써 노력했다. – bdepaz

+0

잘 부탁드립니다. 감사합니다. @bdepaz. – Marco

관련 문제