iOS 개발을 시작했습니다. 나는 며칠 동안 해결책을 찾고 있었지만 그것을 얻을 수는 없다.ViewController에서 속성을 찾을 수 없습니다.
@interface SAProfileViewController : UITableViewController {
@public NSNumber *userId;
}
@property (weak, nonatomic) IBOutlet UIView *awesomeProfileHeader;
@property (nonatomic, assign) NSNumber *userId;
@end
내가 내 재산을 선언하고, 그 후에 나는 이렇게 볼 수 있듯이 :
@implementation SAProfileViewController
@synthesize userId = _userId;
...
을 내가 SAProfileViewController을 가져 오려면 다른의 ViewController에 다음 코드를 얻었다.
#import "SAProfileViewController.h"
...
-(void)goToUserProfile :(id) sender
{
UITapGestureRecognizer *gesture = (UITapGestureRecognizer *) sender;
SAProfileViewController *controller = [[SAProfileViewController alloc] init];
controller.userId = gesture.view.tag; // << HERE THE ERROR APPEARS
[self.navigationController pushViewController:controller animated:YES];
}
그것 뿐이다 즉,이 내 코드와 나는 다음과 같은 오류가 발생합니다 :. "사전에 'SAProfileViewController *'
감사 유형의 개체에없는 속성 'userId를'
엄. 프로젝트를 청소 하시겠습니까? 또한 : 컴파일하면 충돌이 발생합니다. 'controller.userId'와'gesture.view.tag'의 유형을보십시오. –