난 로컬 인스턴스 변수 및 특성에 대한 파라미터 값을 할당하는 다음 방법에 몇 가지 매개 변수를 전달 및 AM 경우이다 인스턴스 변수에 값을 할당 할 수 없다 이것은 (SYNTHESIS으로 업데이트)여기
@interface MenuVC(){
UIView *ownerView_;
UIView *topView_;
menuPosition position_;
}
@property (nonatomic, retain) UIView *ownerView;
@property (nonatomic, retain) UIView *topView;
@property (assign) menuPosition position;
@end
@implementation MenuVC
@synthesize list, menuDelegate;
@synthesize ownerView = ownerView_;
@synthesize topView = topView_;
@synthesize position = position_;
- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
{...
열거 형이 정의된다 :
typedef enum {
above,
below,
centered
} menuPosition;
Afte을
수신 된 파라미터 값 괜찮 보이지만 인스턴스 변수 ownerView_
및 position_
의 할당 된 값은 오른쪽 아니다 : R 디버거 브레이크 포인트, 세 할당을 실행 한 값은 아래와 같다. 반면에 topView
은 괜찮습니다.
속성보다는 ivars에 직접 할당 할 때 똑같은 일이 발생했습니다.
Lion (10.7.3) 및 XCode 4.3.1로 업그레이드 할 때이 문제가 발생하기 시작했습니다. 그 전에는 괜찮 았어. 내 애플 리케이션의 다른 장소에서 이것을보고, 나는 그것에 어떤 패턴을 볼 수 없습니다.
ARC가 사용되지 않습니다.
전에이 문제를보고했지만 답변을 얻지 못했습니다. 이 경우 문제 설명은 더 간단합니다. 그러면 문제가 무엇인지 쉽게 파악할 수 있습니다.
UPDATE - 헤더 파일은 속성을 합성하지 않았다
#import <UIKit/UIKit.h>
@class MenuVC;
@protocol menuDelegateProtocol
typedef enum {
above,
below,
centered
} menuPosition;
- (void) didSelectItemFromMenu:(MenuVC *)menu atIndex:(NSUInteger) index;
@end
@interface MenuVC : UITableViewController {
NSArray *list;
float extendedHeight;
id<menuDelegateProtocol> menuDelegate;
}
@property (nonatomic, retain) NSArray *list;
@property (nonatomic, assign) id<menuDelegateProtocol> menuDelegate;
- (id) initWithFrame:(CGRect)frame style:(UITableViewStyle)style;
- (void) hide;
- (void) unhide;
- (void) assignOwnerView:(UIView*)oView andPosition:(menuPosition)position withTopView:(UIView*)topView;
@end
합성 문을 볼 수 있습니까? 그 이름은 범인이 될 수있는 것처럼 보입니다. 또한 디버그 화면을 생성하는 입력의 예가 아프지 않습니다. –
좋아요, 이제 합성 문장이 생겼습니다. 처음 업데이트 할 때 취소해야합니다. – Jim
값을 NSLog()로 시도하십시오. 디버거가 혼란 스러울 수 있습니다 (최적화가 설정된 경우 디버거가 더 자주 발생합니다). –