好吧,我一直试图围绕这个http直播流媒体.我只是不明白,是的,我已经阅读了所有的苹果文档并观看了wwdc视频,但仍然非常困惑,所以请帮助一个想成为一个程序员!
你写的代码在服务器上?不是在xcode?如果我是对的,我如何设置它?我需要在服务器上设置一些特殊的东西吗?喜欢php还是什么?如何使用Apple .. segmenter等提供的工具?
请帮帮我,谢谢
好的,我已经在这几天工作了,而且我被卡住了.我想要做的是将当前时间与预定时间进行比较.我想要发生的是,每天在某些时候我想要触发某些代码,但不是在我指定的时间之前.
因此,基本上如果"当前时间"与"预定时间"相同或相等,则触发此代码.或者解雇这行代码.
听起来很简单,但我在抓两次比较时遇到了麻烦.
我已经将字符串格式化为这样的日期
NSString* dateString = @"11:05 PM";
NSDateFormatter* firstDateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[firstDateFormatter setDateFormat:@"h:mm a"];
[firstDateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
NSDate* date = [firstDateFormatter dateFromString:dateString];
NSLog(@"date %@",date);
Run Code Online (Sandbox Code Playgroud)
然后我像这样抓住当前的时间
NSDate *currentTime = [NSDate dateWithTimeIntervalSinceNow:[[NSTimeZone localTimeZone] secondsFromGMT]];
NSDateComponents* comps = [[NSCalendar currentCalendar]
components: NSHourCalendarUnit |NSMinuteCalendarUnit
|NSSecondCalendarUnit fromDate:currentTime];
[[NSCalendar currentCalendar] dateFromComponents:comps];
Run Code Online (Sandbox Code Playgroud)
那我该怎么比较这两次呢?我已经尝试了我能想到的一切,请帮忙.
我正在测试我的应用程序而且我一直在接收这些泄漏,但它们都没有在我的代码中.我想,还有其他人有这些问题吗?
__NSCFDictionary 0x5f8cfe0 48 AudioToolbox SimAggregateDevice::SimAggregateDevice(__CFString const*, __CFString const*, long&)
Malloc 32 Bytes 0x5f83a00 32 AudioToolbox SimAggregateDevice::SimAggregateDevice(__CFString const*, __CFString const*, long&)
Malloc 48 Bytes 0x5f839d0 48 AudioToolbox SimAggregateDevice::SimAggregateDevice(__CFString const*, __CFString const*, long&)
Malloc 32 Bytes 0x5f839b0 32 AudioToolbox CreateDictionaryForDevice(unsigned long)
Malloc 32 Bytes 0x5f83990 32 AudioToolbox CreateDictionaryForDevice(unsigned long)
__NSCFDictionary 0x5f83960 48 AudioToolbox CreateDictionaryForDevice(unsigned long)
Malloc 32 Bytes 0x5f83940 32 AudioToolbox SimAggregateDevice::SimAggregateDevice(__CFString const*, __CFString const*, long&)
__NSCFArray 0x5f838b0 32 AudioToolbox SimAggregateDevice::SimAggregateDevice(__CFString const*, __CFString const*, long&)
Run Code Online (Sandbox Code Playgroud)
任何帮助都会很棒,谢谢......是的...一个新手.
我很确定有更好的方法来实现我想要做的事情,我只是尝试不同的途径来看看什么对我最有用......所以我有一个带有4个段的UISegmentedController.我在界面生成器中给了每个标题,我想要做的是当他们按某个片段时会播放相应的视频.我正在使用webview,因为......这就是我所知道的...到目前为止......这是我的代码:
-(IBAction) getVideo: (id) sender
{
NSURL *videoURl;
NSString *videoURLString;
NSString *video;
video = [videoChoice titleForSegmentAtIndex:
videoChoice.selectedSegmentIndex];
if (video = @"Shimmy") {
videoURLString = [[NSString alloc] initWithFormat:
@"http://www.andalee.com/iPhoneVideos/mov.MOV"];
} else if (video = @"Camel") {
videoURLString = [[NSString alloc] initWithFormat:
@"http://www.andalee.com"];
} else {
videoURLString = [[NSString alloc] initWithFormat:
@"http://www.yahoo.com"];
}
videoURl = [[NSURL alloc] initWithString: videoURLString];
[videoView loadRequest: [NSURLRequest requestWithURL: videoURl]];
[videoURl release];
[videoURLString release];
}
Run Code Online (Sandbox Code Playgroud)
因此,当我使用它(视频= @"Shimmy")时,它直接进入视频,但对于每个片段都是相同的...现在,如果我将其更改为(video == @"Shimmy"),它会直接转到其他部分没有其他的.顺便说一句,现在的链接只是试图了解机制.
ios ×4
iphone ×3
autolayout ×1
debugging ×1
if-statement ×1
instruments ×1
memory-leaks ×1
nsdate ×1
objective-c ×1
sdk ×1
uitextfield ×1