小编Win*_*ton的帖子

为什么不在Xcode 6中自动创建ProjectName-Prefix.pch?

为什么不ProjectName-Prefix.pch自动创建Xcode 6

是否不再需要预编译头?

我应该在哪里写下之前的代码ProjectName-Prefix.pch

xcode ios xcode6

261
推荐指数
8
解决办法
11万
查看次数

Xcode一直要求密码才能使用System Keychain

我在Lion 10.7.3下运行Xcode 4.3.2,但每次我在设备上安装我的iPhone应用程序时,它都会一直询问我管理员用户名和密码.

我已经完成了这里建议的所有事情,甚至重新安装了Xcode:

另一个与StackOverflow相关的问题

但到目前为止没有成功.

这是一直出现的窗口图片:

Xcode 4.3.2一直要求管理员用户名和密码

关于如何解决这个问题的任何其他建议?

xcode objective-c ios

81
推荐指数
5
解决办法
6万
查看次数

如何获取视频文件的持续时间?

我是Android编程的初学者.

我正在编写一个应用程序来列出文件夹中的所有视频文件,并显示该文件夹中所有视频的信息.但是,当我尝试获取视频持续时间时,它返回null,我找不到获取它的方法.

任何人都可以帮助我吗?

以下是我的代码:

Uri uri = Uri.parse("content://media/external/video/media/9");
Cursor cursor = MediaStore.Video.query(res, data.getData(), new String[]{MediaStore.Video.VideoColumns.DURATION});
if(cursor.moveToFirst()) {
    String duration = cursor.getString(0);
    System.out.println("Duration: " + duration);
}
Run Code Online (Sandbox Code Playgroud)

android

60
推荐指数
4
解决办法
4万
查看次数

如何绘制UIImage或直接在-drawRect:?

我有一个UIImage我想画的UIView.但是我没有创建UIImageView并将其添加为子视图,而是想直接覆盖-drawRect:并绘制我的UIView.

例如,我的代码如下所示:

- (void)drawRect:(CGRect)rect {
    CGContextRef myContext = UIGraphicsGetCurrentContext();

    UIImage *img = [UIImage imageNamed:@"foo.png"];

    // how to draw the directly into the view now?
}
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch uiimage drawrect

46
推荐指数
2
解决办法
5万
查看次数

如何从NSArray获得NSNumber的总和?

我有一个像大等NSArray包含...NSNumbers3, 4, 20, 10, 1, 100,

如何将所有这些NSNumber的总和(3 + 4 + 20 + 10 + 1 + 100 + etc...)作为一个总和NSInteger

谢谢!

iphone objective-c nsnumber nsarray nsinteger

24
推荐指数
3
解决办法
2万
查看次数

AVPlayer的音频测量级别

有没有办法从AVPlayer类获得音频测量级别?

我知道AVAudioPlayer会这样做,但它不像AVPlayer那样播放流式http .m3u8网址.

iphone objective-c avaudioplayer ios avplayer

15
推荐指数
1
解决办法
2688
查看次数

如何在Android上播放背景中的流式音频?

我有一个Android应用程序,使用MediaPlayer该类播放来自Internet的流式音频.

当用户点击主页按钮运行其他应用程序时,如何让它继续在后台播放音频?

在运行其他应用程序时,我希望它继续播放音频.

android media-player

13
推荐指数
1
解决办法
2万
查看次数

使用NSRegularExpression在iPhone上提取URL

我在我的iPhone应用程序上使用以下代码,从这里获取条带.html代码中的所有URL.

我只能提取第一个URL,但我需要一个包含所有 URL 的数组.我的NSArray没有为每个URL返回NSStrings,只返回对象描述.

如何arrayOfAllMatches以NSStrings的形式返回所有网址?

-(NSArray *)stripOutHttp:(NSString *)httpLine {

// Setup an NSError object to catch any failures
NSError *error = NULL;  

// create the NSRegularExpression object and initialize it with a pattern
// the pattern will match any http or https url, with option case insensitive

NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"http?://([-\\w\\.]+)+(:\\d+)?(/([\\w/_\\.]*(\\?\\S+)?)?)?" options:NSRegularExpressionCaseInsensitive error:&error];

// create an NSRange object using our regex object for the first match in the string httpline
NSRange rangeOfFirstMatch = [regex …
Run Code Online (Sandbox Code Playgroud)

regex objective-c nsstring nsarray nsregularexpression

12
推荐指数
4
解决办法
2万
查看次数

如何解析android中url的xml?

我目前正在使用已经从那里下载和解析的xml.我想直接从网址本身做到这一点.我怎样才能做到这一点?

我添加了我在下面使用的代码段.请帮助一个片段或例子.谢谢.

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
File file = new File(this.getFilesDir(), FILE_EXTRACTED);
Document dom = builder.parse(file);
Element root = dom.getDocumentElement();
root.normalize();
Run Code Online (Sandbox Code Playgroud)

url android xml-parsing

12
推荐指数
3
解决办法
4万
查看次数

在执行问题之前,是否为所有行调用了heightForRowAtIndexPath以及UITableView中的行数?

我以为我已经读到了UITableView那个heightForRowAtIndexPath不会被调用的所有行,但只对那些将是可见的.然而,这不是我所看到的.我正在看到数以百计的调用heightForRowAtIndexPath,例如iPhone的方向改变的简单情况.

所以我在此假设,因此,对于UITableViewheightForRowAtIndexPath实施,它(即heightForRowAtIndexPath)被调用的所有行(不只是那些可见的)...让我知道这是不太正确的.

问题:鉴于上述情况,在性能问题发生之前,您可以拥有多少行UITableView(在哪里heightForRowAtIndexPath实现)?

有没有解决性能问题的方法?即设置每行的标称/标准高度而不实现heightForRowAtIndexPath,但是只有在显示时才正确设置每一行高度并在此处正确设置...但是哪种方法可以做到这一点?

iphone uitableview ios heightforrowatindexpath

11
推荐指数
1
解决办法
9322
查看次数