タイプライターのように 1 文字ずつ入力する NSString アニメーションを作成します。文字列は UILabel に配置されます。可能です?はいの場合、どのように?
前もって感謝します。
アップデート
woz の方法はうまく機能しますが、問題の解決には使用できません。私は自分の状況を説明しようとします。最初のビューの私のアプリでは、実際の位置を表示するので、これらのメソッドを追加しました:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
//NSLog(@"didUpdateToLocation: %@", newLocation);
CLLocation *currentLocation = newLocation;
if (currentLocation != nil) {
longitude.text = [NSString stringWithFormat:@"%.3f", currentLocation.coordinate.longitude];
latitude.text = [NSString stringWithFormat:@"%.3f", currentLocation.coordinate.latitude];
}
NSLog(@"Resolving the Address");
[geocoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray *placemarks, NSError *error) {
//NSLog(@"Found placemarks: %@, error: %@", placemarks, error);
if (error == nil && [placemarks count] > 0) {
placemark = [placemarks lastObject];
[address sizeToFit];
address.text = [NSString stringWithFormat:@"%@, %@\n%@ %@\n%@",
[self sanitizedDescription:placemark.thoroughfare],
[self sanitizedDescription:placemark.subThoroughfare],
[self sanitizedDescription:placemark.postalCode],
[self sanitizedDescription:placemark.locality],
[self sanitizedDescription:placemark.country]];
} else {
NSLog(@"%@", error.debugDescription);
}
} ];
}
- (NSString *)sanitizedDescription:(NSString *)obj
{
if (obj == nil)
{
obj = @"...";
return obj;
}
return obj;
}
if (obj == nil)
on- (NSString *)sanitizedDescription:(NSString *)obj
が呼び出されたときに、タイプライター アニメーションを使用します。どのようにできるのか?
申し訳ありませんが、私は Obj-C から始めています :(