小编mt8*_*t81的帖子

applicationMusicPlayer卷通知

我正在使用applicationMusicPlayer,当我尝试更改音量时会出现视觉通知,如图所示.这里是我使用的代码:

[MPMusicPlayerController applicationMusicPlayer] setVolume:newVolune];
Run Code Online (Sandbox Code Playgroud)

有谁知道如何隐藏此通知?

在此输入图像描述

volume objective-c mpmusicplayercontroller ios

14
推荐指数
1
解决办法
9223
查看次数

为什么缓冲区需要在 NSInvocation 上 __unsafe_unretained - getArgument:atIndex:?

我正在使用NSInvocation并需要从中检索属性之一。

我正在使用以下代码,但我有一些奇怪的行为调用[invocation invoke];

NSString *propertyName = nil;
[invocation getArgument:&propertyName atIndex:3];
Run Code Online (Sandbox Code Playgroud)

我读到为了使其在 ARC 下工作,我们需要使用__unsafe_unretained

__unsafe_unretained NSString *propertyName = nil;
[invocation getArgument:&propertyName atIndex:3];
Run Code Online (Sandbox Code Playgroud)

成功了,不错!!但我想知道为什么。谁能解释一下?

objective-c ios

4
推荐指数
1
解决办法
396
查看次数