我已经集成了远程推送通知,但是我收到了这个警告:
didReceiveRemoteNotification:fetchCompletionHandler:],但你仍然需要添加"remote-notification"到列表的支持UIBackgroundMode在你的SInfo.plist.
我的Xcode版本是8.3.1.我真的想把它添加到Info.plist.我也遵循了一些教程,但他们也没有提到这一点.我该怎么办?
您好我已将UISlider最小值设置为0.00.然后我以这种方式设置它的最大值.
self.viewPlayer.layer.addSublayer(playerLayer)
let duration : CMTime = avPlayer.avPlayer.currentItem!.asset.duration
let seconds : Float64 = CMTimeGetSeconds(duration)
sliderBar.maximumValue=Float(seconds)
sliderBar!.isContinuous = false
sliderBar!.tintColor = UIColor.green
Run Code Online (Sandbox Code Playgroud)
但我得到了这个例外
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to set a slider's minimumValue (0.000000) to be larger than the maximumValue (nan)'
enter code here
Run Code Online (Sandbox Code Playgroud)
我知道在prepareForPlay()实际播放之后需要一些时间来真正播放视频.那么如何才能检测到播放器何时真正开始播放视频?请帮我.谢谢
我从服务中获取天数,开始日期和结束日期.我想获得开始日期和结束日期之间所有日期的列表.假设我的开始日期是2017/08/15,结束日期是2017/08/16,天数是2.
但我得到这样的日期列表.
##### CONVERTED STRING DATE 2017-08-16
##### CONVERTED STRING DATE 2017-08-17
##### CONVERTED STRING DATE 2017-08-18
Run Code Online (Sandbox Code Playgroud)
我有另一个这样的日期
开始日期2017/08/23结束日期2017/09/01和天数8.然后我得到这样的列表.
##### CONVERTED STRING DATE 2017-08-24
##### CONVERTED STRING DATE 2017-08-25
##### CONVERTED STRING DATE 2017-08-28
##### CONVERTED STRING DATE 2017-08-29
##### CONVERTED STRING DATE 2017-08-30
##### CONVERTED STRING DATE 2017-08-31
##### CONVERTED STRING DATE 2017-09-01
Run Code Online (Sandbox Code Playgroud)
这就是我获取日期数组的方法
numberOfDates=Int(ceil(numOfDay))
//numberOfDates=numberOfDates-1
let arrayDates=self.generateDates(startDate: startDate, addbyUnit: .day, value: numberOfDates)
Run Code Online (Sandbox Code Playgroud)
这是我的日期计算方法
internal func generateDates(startDate :Date?, addbyUnit:Calendar.Component, value : Int) -> [Date]
{
//print("####START DATE#######\(startDate)")
var calendar …Run Code Online (Sandbox Code Playgroud) 您好,我想为我添加这种阴影我该NAvigationBar怎么做.
这就是我尝试添加阴影的方式.
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage=[UIImage new];
self.navigationController.navigationBar.translucent=YES;
self.navigationController.navigationBar.topItem.titleView.tintColor=[UIColor whiteColor];
self.navigationController.navigationBar.titleTextAttributes=[NSDictionary dictionaryWithObject:[UIFont fontWithName:@"HelveticaNeue" size:15.0f] forKey:NSFontAttributeName];
self.navigationController.navigationBar.topItem.title=strNavigtionTitle;
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"backarrow"] style:UIBarButtonItemStylePlain target:self action:@selector(revealToggle :)];
[self.navigationController navigationBar].tintColor = [UIColor whiteColor];
[self.navigationController navigationBar].layer.shadowColor=[UIColor colorWithRed:53.0/255.0 green:108.0/255.0 blue:130.0/255.0 alpha:1.0f].CGColor;
[self.navigationController navigationBar].layer.shadowOffset=CGSizeMake(0, 20);
[self.navigationController navigationBar].layer.shadowOpacity=0.8;
[self.navigationController navigationBar].layer.shadowRadius=5.5;
Run Code Online (Sandbox Code Playgroud)
但这只会为箭头和我的Apply Leave标题添加阴影.但是我想添加一个像这个图像中的阴影.它应该在NavigationBar和我的主要之间UIView我该怎么做?请帮我.谢谢
我有一个用Swift 2编写的应用程序.还有这样的一行.
semaphore.wait(timeout: dispatch_time_t(DISPATCH_TIME_FOREVER));
Run Code Online (Sandbox Code Playgroud)
但是这一行在Swift 3中显示为错误.如何将其转换为Swift 3.
请帮我.谢谢
我以这种方式从给定日期获取年、月和日。
let today=Date()
var calendar = Calendar.current
calendar.timeZone = .current
let components = calendar.dateComponents([.year, .month, .day], from: today)
let day=components.day
Run Code Online (Sandbox Code Playgroud)
但是我比现在提前了一天。我该如何解决这个问题?
你好,我有一个项目,有人已经开发.它有G +,FB集成.当我得到项目并尝试运行它时,它给了我这个错误.我怎么能解决这个问题?请帮我.
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_CMMotionManager", referenced from:
objc-class-ref in GooglePlus(GPPSpamSignal.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
谢谢
我已经为我的应用程序集成了推送通知。为了捕捉通知,我使用了这个委托。
-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo在我的应用程序委托中。
所以当应用程序在后台运行时,如果通知来了,当我点击它时,这个委托就会触发。如果应用程序即使在后台也没有运行,如果点击 ntification 然后它会触发
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
到目前为止它运作良好。然后我想在后台捕捉通知。所以我发现
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
这对它有用。
所以我只是将我以前的didReceive方法更改为这种新didReceive方法。现在我的问题是当应用程序通过推送通知启动时(如果应用程序不在后台或前台运行,并且当出现时单击通知)我的应用程序崩溃。即使我无法调试和捕捉这种情况。
这两个代表有什么区别。当应用程序通过通知启动时,我的第二个代表是否会触发?请帮我。
在我的 iOS 应用中,我启用了强制应用更新功能。它是这样的。
如果有一个严重的错误修复。在服务器中,我们正在设置新的发布版本。在启动画面中,我正在检查当前的应用程序版本,如果它低于服务版本,则会显示一条消息以更新应用程序。
我已经放置了 2 个按钮“立即更新”、“稍后更新”
我有2个问题
如果我现在点击。应用程序应该使用更新按钮在应用程序商店中打开我的应用程序。目前我使用链接“ http://appstore.com/mycompanynamepvtltd ”这会打开我公司应用程序的列表,但它有按钮打开,即使我的应用程序有新的更新,也没有更新。更新页面的网址是什么?
如果他单击“稍后更新”按钮是否可以以编程方式关闭应用程序?这是否会导致在应用商店中拒绝我的应用?
请帮我解答这两个问题
AVPlayer即使 url 流同时包含音频和视频,有没有办法只播放音频?
ios ×10
swift3 ×4
avplayer ×2
date ×2
swift ×2
app-store ×1
dispatch ×1
dropshadow ×1
info-plist ×1
objective-c ×1
quartz-core ×1
semaphore ×1
uislider ×1