添加SightingViewControler.h
@property (weak, nonatomic) IBOutlet UITextField *estrenoInput;
添加SightingViewControler.m
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"ReturnInput"]) {
if ([self.movieTitleInput.text length] || [self.generoInput.text length] || [self.directorInput.text length]|| [self.estrenoInput.text length] )
{
MovieSighting *sighting;
NSUInteger *valor = (NSUInteger *)[[self.estrenoInput text] integerValue];
sighting = [[MovieSighting alloc] initWithName:self.movieTitleInput.text anyo:valor genero:self.generoInput.text director:self.directorInput.text];
self.movieSighting = sighting;
}
}
}
我用这个:NSUInteger *valor = (NSUInteger *)[[self.estrenoInput text] integerValue];
转换它但是当我点击完成时,应用程序退出。
有人做过不同的转换器吗?