我有例如TREE.wav,ONE.WAV.我想将它重命名为tree.wav,one.wav.如何将所有文件重命名为小写?
如何以UISegmentedControll编程方式切换?
我没有收到任何通知MPMoviePlayerController.我究竟做错了什么?
我使用以下逻辑.
我开始播放youtube视频了UIWebView.UIWebView称之为标准MPMoviePlayerController.我不控制MPMoviePlayerController因为我没有实例化MPMoviePlayerController.
我使用自动播放运行youtube的剪辑(延迟1秒):
[self performSelector:@selector(touchInView:) withObject:b afterDelay:1];
Run Code Online (Sandbox Code Playgroud)
我的代码是:
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loadStateDidChange:) name:MPMoviePlayerLoadStateDidChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playbackDidFinish:) name:MPMoviePlayerDidExitFullscreenNotification object:nil];
[self embedYouTube];
}
- (void)loadStateDidChange:(NSNotification*)notification
{
NSLog(@"________loadStateDidChange");
}
- (void)playbackDidFinish:(NSNotification*)notification
{
NSLog(@"________DidExitFullscreenNotification");
}
- (void)embedYouTube
{
CGRect frame = CGRectMake(25, 89, 161, 121);
NSString *urlString = [NSString stringWithString:@"http://www.youtube.com/watch?v=sh29Pm1Rrc0"];
NSString *embedHTML = @"<html><head>\
<body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>"; …Run Code Online (Sandbox Code Playgroud) youtube mpmovieplayercontroller mpmovieplayer nsnotificationcenter ios
我使用timeZoneWithName,但我不知道时区的名称.我在哪里可以找到时区列表?
[NSTimeZone timeZoneWithName:@"US/Eastern"];
Run Code Online (Sandbox Code Playgroud) 我想向alertview显示消息:"正在加载数据"和旋转活动指示器.我怎样才能做到这一点?
我调用addImageToQueue后,我的应用程序崩溃了.我添加了initWithObjects:forKeys:count:但它没有帮助我.
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '*** -[NSDictionary initWithObjects:forKeys:count:]:
method only defined for abstract class.
Define -[DictionaryWithTag initWithObjects:forKeys:count:]!'
Run Code Online (Sandbox Code Playgroud)
我的代码
- (void)addImageToQueue:(NSDictionary *)dict
{
DictionaryWithTag *dictTag = [DictionaryWithTag dictionaryWithDictionary:dict];
}
@interface DictionaryWithTag : NSDictionary
@property (nonatomic, assign) int tag;
- (id)initWithObjects:(id *)objects forKeys:(id *)keys count:(NSUInteger)count;
@end
@implementation DictionaryWithTag
@synthesize tag;
- (id)initWithObjects:(id *)objects forKeys:(id *)keys count:(NSUInteger)count
{
return [super initWithObjects:objects forKeys:keys count:count];
}
@end
Run Code Online (Sandbox Code Playgroud) 我如何解雇UIAlertView?此代码不起作用.
@property (nonatomic, retain) UIAlertView *activityAlertView;
- (void)viewDidLoad
{
self.activityAlertView = [[UIAlertView alloc] initWithTitle:@"Receiving data" message:@"\n\n"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil, nil];
[activityAlertView show];
}
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
}
-(void) myfunc
{
[self alertView:activityAlertView clickedButtonAtIndex:1];
}
Run Code Online (Sandbox Code Playgroud) ios ×7
iphone ×3
uialertview ×2
avplayer ×1
bash ×1
crash ×1
css ×1
file ×1
html ×1
macos ×1
nsdictionary ×1
nstimezone ×1
xcode ×1
xcode4 ×1
youtube ×1