可能重复:
自动重复播放
我怎样才能循环播放声音(我的背景音乐)
这是我的代码:
NSString *path = [[NSBundle mainBundle] pathForResource:@"MathMusic" ofType:@"aif"];
AVAudioPlayer* theAudio= [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
Run Code Online (Sandbox Code Playgroud)
如何让它继续进行,如果我循环它还会在下一个(或另一个)视图中播放?
我们在快速枚举中释放一个参数吗?因此,此代码是准确的:
for (MKCircle *circle in localOverlays) {
[mapView addOverlay: circle];
[circle release]; // Is it perfectly alright to call this?
}
Run Code Online (Sandbox Code Playgroud)
我只是想知道,我第一次使用快速枚举!
在某些应用中,您可以直接通过应用发送电子邮件 我看过Flipboard,你可以通过电子邮件将文章发送给朋友,电子邮件内部是超链接的文字,如下所示:
通过Flipboard发送
因此,只需单击文本即可将您定向到页面.我怎样才能做到这一点?我不想将链接添加为邮件正文的一部分,因为它非常混乱和丑陋...我更喜欢这种可点击的文本方式.
谢谢!
我正在创建一个带有 S3 的 iOS 应用程序,目前没有发行版 (CloudFront) 作为测试,然后再透露创建一个完整的承诺应用程序。在 S3 管理控制台中,我在我居住的新加坡制作了我的存储桶,因此此演示并不真正需要 CloudFront。我必须设置这样的端点:
[s3Client setEndpoint: [AmazonEndpoints s3Endpoint: AP_SOUTHEAST_1]];
Run Code Online (Sandbox Code Playgroud)
哪个指向新加坡,端点是存储桶需要将数据发送到的地方吗?(用户在哪里)
所以现在我有两个问题
如果我使用 CloudFront,是否需要设置终端节点?我什至如何在 iOS 中使用 CloudFront,我生成一个签名 URL 然后呢?
如果用户在随机国家/地区使用该应用程序,可以说,如果我需要设置(使用 CloudFront),我会将其设置为哪个端点?我会通过语言环境找到他们当前的国家并找到它最接近的端点吗?
谢谢!
这只是我害怕的事情.我知道当你删除应用程序时,数据NSUserDefaults
会被删除.当用户更新时会发生这种情况吗?在这种情况下,我应该将默认数据备份到另一台服务器/系统.
谢谢你们,试着采取预防措施.
我想要做的是解析网站上页面的多个部分.这是我在做的事情:
NSURL *tutorialsUrl = [NSURL URLWithString:@"http://www.cetsp.com.br/"];
NSData *tutorialsHtmlData = [NSData dataWithContentsOfURL:tutorialsUrl];
TFHpple *tutorialsParser = [TFHpple hppleWithHTMLData:tutorialsHtmlData];
NSArray *holder;
NSString *tutorialsXpathQueryString = @"//div[@class='info oeste']/a/h4";
NSString *tutorialsXpathQueryString2 = @"//div[@class='info norte']/a/h4";
NSString *tutorialsXpathQueryString3 = @"//div[@class='info centro']/a/h4";
NSString *tutorialsXpathQueryString4 = @"//div[@class='info leste']/a/h4";
NSString *tutorialsXpathQueryString5 = @"//div[@class='info sul']/a/h4";
NSArray *oeste = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString];
NSArray *norte = [tutorialsParser searchWithXPathQuery: tutorialsXpathQueryString2];
NSArray *centro = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString3];
NSArray *leste = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString4];
NSArray *sul = [tutorialsParser searchWithXPathQuery: tutorialsXpathQueryString5];
holder = [[NSArray alloc] initWithObjects:norte, oeste, centro,leste,sul, nil];
for (NSArray …
Run Code Online (Sandbox Code Playgroud) 我尝试为我的游戏制作一个简单的分数系统,我正在使用字典并使用NSUserDefaults保存它来存储玩家的分数.但是,当我尝试将新分数设置为现有键/值时,应用程序崩溃,没有任何控制台日志消息,并且xcode切换到不可读的汇编程序代码.我知道崩溃的地方,因为我设置了异常,它显示了它被调用的行.如果改变了什么,我也会使用cocos2d.
这是代码:
//creates key for the right level
NSString *currentLevelString = [NSString stringWithFormat:@"Level%i",numberOfCurentLevel];
//checking if dictionary is empty, if empty then it means the game is played for the first time
NSMutableDictionary *dictionary = [[[NSMutableDictionary alloc]init]autorelease];
//ud is the UserDefaults
dictionary = [ud objectForKey:@"dictionaryWithScores"];
if ([dictionary objectForKey:@"Level5"] == nil) {
//assigning first values for empty dictionary
dictionary = [NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle]pathForResource:@"ScoreList" ofType:@"plist"]];
NSLog(@"dictionary was empty");
}
//NSLog(@"now dictionary shoud not be empty %@",dictionary);
//calculating current score for this level
double …
Run Code Online (Sandbox Code Playgroud) xcode objective-c nsdictionary cocos2d-iphone nsmutabledictionary
我正在制作一个按钮播放声音,就像按钮声音效果,例如在jely car 3中,当你像新的游戏按钮一样按下它会产生类似"boop"的声音效果.我已经做到了,但ios模拟器上有大量的延迟,这意味着iphone HELP TKS会有更多!
objective-c ×6
ios ×5
xcode ×4
amazon-s3 ×1
email ×1
hpple ×1
html ×1
hyperlink ×1
loops ×1
nsdictionary ×1