AddSightingViewControler.h
@property (weak, nonatomic) IBOutlet UITextField *estrenoInput;
AddSightingViewControler.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];
それを変換しますが、[完了] をクリックするとアプリが終了します。
別のコンバーターを使用した人はいますか?