NSInteger myInt = 1804809223;
NSLog(@"%i", myInt); <====
Run Code Online (Sandbox Code Playgroud)
上面的代码产生错误:
Values of type "NSInteger" should not be used as format arguments: add an explicit cast to 'long' instead.
Run Code Online (Sandbox Code Playgroud)
正确的NSLog消息实际上NSLog(@"%lg", (long) myInt);为什么我要将myInt的整数值转换为long,如果我想要显示该值?
假设我有一个串行调度队列,我在其上排队了几个操作.我已经读过,一旦发送,我就无法取消操作.是否有可能至少查看我发送的GCD块可能会做出决定,如果我想再派一个?
例如,我将操作A分派给队列,但在我的应用程序决定将另一个操作A排入队列之后不久,所以现在有两个这样的操作排队.
嗨!我正在从视频网址捕获视频的缩略图.我正在使用以下代码来捕获缩略图
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:movieURL];
[moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[moviePlayer setFullscreen:YES];
moviePlayer.useApplicationAudioSession = NO;
UIImage *image = [moviePlayer thumbnailImageAtTime:(NSTimeInterval)1.0 timeOption: MPMovieTimeOptionNearestKeyFrame];
Run Code Online (Sandbox Code Playgroud)
我正在使用线程.我收到以下错误:
电影播放器的激活状态错误(1)
有谁能够帮我?
好的,我知道如何使用cpan安装Perl模块并且已经使用了多年.但是当我尝试在这个特定的mac上安装DateTime模块时,它失败了,声称它找不到编译器.
以下是尝试安装其中一个先决条件的一些输出,Params :: Validate :(我在尝试安装相关模块时遇到了同样的错误.)
Configuring Params-Validate-1.00
Running Build.PL
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
lipo: can't open input file: /var/tmp//cc3Aefez.out (No such file or directory)
Warning: ExtUtils::CBuilder not installed or no compiler detected
Proceeding with configuration, but compilation may fail during Build
Run Code Online (Sandbox Code Playgroud)
为什么Build.PL正在寻找ppc编译器?如果这是问题我在哪里告诉它(或cpan,或cpanm)这台机器不是ppc盒子?
我跑10.6.8.perl的版本是为darwin-thread-multi-2level构建的v5.10.0
我绝对安装了Developer工具.
我通过sudo运行cpan和cpanm.
我很感激任何人都可以提供帮助.
我用下面的文件目录创建文件夹,我的问题是,如何隐藏这个文件夹,这样当我允许itune共享这个文件夹时不会出现给用户
/*创建新目录*/NSFileManager*filemgr; NSArray*dirPaths; NSString*docsDir; NSString*newDir;
filemgr =[NSFileManager defaultManager];
dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
newDir = [docsDir stringByAppendingPathComponent:@"Patients"];
NSLog(newDir);
if(! [self SearchForDirectory:newDir] )
{
NSLog(@"directory Not Exists");
if ([filemgr createDirectoryAtPath:newDir withIntermediateDirectories:YES attributes:nil error: NULL] == NO)
{
NSLog(@"Failed to create directory");
}
}
else{
NSLog(@"directory Exists");
}
[filemgr release];
Run Code Online (Sandbox Code Playgroud) 如何将字符串复制到iOS中的剪贴板?我在文档中搜索"剪贴板",没有点击.
objective-c ×4
xcode ×3
ios ×2
casting ×1
cocoa-touch ×1
copy-paste ×1
cpan ×1
debugging ×1
iphone ×1
macos ×1
perl ×1
sdk ×1
uipasteboard ×1