我很确定必须有一种方法从我自己的应用程序启动spotify iphone应用程序.我已经看到SMP应用程序(分享我的播放列表)在将播放列表推入spotify应用程序时做了类似的事情.
我猜应该是这样的:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"spotify://search:muse"]];
Run Code Online (Sandbox Code Playgroud)
如您所见,我希望能够对特定关键字进行spotify搜索.问题是我真的不知道spotify网址方案,如果有这样的东西可用.
我一直在网上搜索,在spotify开发者网站等搜索,但没有出现......
我正在视图持有者/适配器模式之后创建"文档"的网格视图.在活动中,我从网络类中获得回调,因此我需要能够在不同的时间更新每个网格单元.
我这样做的方法是通过从对象元素(文档)到相应的视图持有者的映射映射.我需要这样做,因为适配器正在循环使用单元格,所以有时我可以收到一个回调来更新一个不可见的单元格,在这种情况下,回调信息将被忽略.
我可以看到getView适配器的方法被多次调用为位置0.我一直在读这是正常的.
inflating position 0 *** progressBar 1
recycling position 0
recycling position 0
inflating position 0 *** progressBar 2
recycling position 0
recycling position 0
recycling position 0
recycling position 0
recycling position 0
recycling position 0
Run Code Online (Sandbox Code Playgroud)
UI我需要从回调中更新的一个元素是一个进度条,我通过添加viewHolder到与文档关联的Map来跟踪.
除了第一个方法之外,这整个方法适用于所有位置.我可以识别的唯一区别是这些多次调用,getView所以我从那里开始调试.在progressBar我更新为" progressBar2",这是最新的geView夸大,但实际上它并没有给回应setVisible(View.VISIBLE).然后我对代码进行了一些更改以更新" progressBar1"并且它可以工作.
这意味着getView相同位置膨胀两次,但第二次没有被使用或显示.
我能做错什么?为什么progressbar1工作而progressbar2没有?我希望这getView会给我一个与职位相对应的最新观点.
谢谢.
适配器:
public class DocumentPickerGridViewAdapter extends ArrayAdapter<Document> implements Filterable {
private final DocumentPickerGridViewController picker;
private ArrayList …Run Code Online (Sandbox Code Playgroud) 我正在开发一个iphone 4应用程序,它根据不同的标准过滤本地媒体库.我已经能够按歌曲名称,艺术家和流派进行过滤.现在我需要添加一个评级过滤机制.我想的是"评级> = N星"(N:0..5)
我用来过滤的代码是:
allMedia = [MPMediaQuery songsQuery];
MPMediaPropertyPredicate *mpp1 = [MPMediaPropertyPredicate predicateWithValue:@"2" forProperty:MPMediaItemPropertyRating comparisonType:MPMediaPredicateComparisonEqualTo];
[allMedia addFilterPredicate:mpp1];
Run Code Online (Sandbox Code Playgroud)
但是MPMediaPropertyPredicate不允许通过MPMediaItemPropertyRating进行过滤(实际上它适用于艺术家和歌曲标题).
2011-05-12 11:37:39.060 Radio3[1525:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'MPMediaPropertyPredicate cannot filter using the rating property.'
Run Code Online (Sandbox Code Playgroud)
我通过MPMediaItemPropertyRating谷歌,但似乎我应该找到一种替代方法来按轨道评级过滤.
有人可以给我一个提示吗?
谢谢
更新:这是我的代码来解决这个问题:
allMedia = [MPMediaQuery songsQuery];
//MPMediaPropertyPredicate *mpp1 = [MPMediaPropertyPredicate predicateWithValue:@"2" forProperty:MPMediaItemPropertyRating comparisonType:MPMediaPredicateComparisonEqualTo];
//MPMediaPropertyPredicate *mpp2 = [MPMediaPropertyPredicate predicateWithValue:@"Pop" forProperty:MPMediaItemPropertyGenre comparisonType:MPMediaPredicateComparisonContains];
//[allMedia addFilterPredicate:mpp1];
//[allMedia addFilterPredicate:mpp2];
//[myPlayer setQueueWithQuery:allMedia];
NSArray *itemsFromGenericQuery = [allMedia items];
NSMutableArray *mArray = [[NSMutableArray alloc] init];
int i = …Run Code Online (Sandbox Code Playgroud) Phonegap使用位于www文件夹中的html源代码.我正在测试如果index.html仍在www中会发生什么,但它链接到位于服务器端的其他html.它将在Web浏览器中打开服务器端html,而不是作为应用程序的一部分处理它.
有没有办法让phonegap与服务器端html + js源一起工作?
如果您需要混合使用库(jar + ios库),本地phonegap html + js与服务器端动态html代码(如php输出),这不是一个坏主意.
谢谢.
IOS7似乎带有字符串strcpy的新实现(可能是优化).之前我能够从阵列的任何位置复制字符串,但现在如果我从任何位置开始复制(i%4!= 0)它将崩溃.
为了表明这一点,我在iOS6和7中运行了这个代码,它在7上崩溃了应用程序:
char *x = malloc(1024);
strcpy(x, "hello world");
char *x2 = x + 1;
strcpy(x, x2);
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?