草庐IT

bjh-strong

全部标签

ios - 不兼容的指针类型用类型为“BaseClass *”的表达式初始化 'SubClass *__strong'

在objective-C中,为什么我们不能alloc+init或new具有父类(superclass)的基类对象,而我们可以使用父类(superclass)的构造函数来初始化吗?下面是一些代码:s1可以很轻松地创建。NSMutableString*s1=[NSStringstring];NSLog(@"%@",s1);但是s2和s3不能,并给出警告使用类型为“BaseClass*”的表达式初始化“SubClass*__strong”的不兼容指针类型NSMutableString*s2=[[NSStringalloc]init];NSLog(@"%@",s2);NSMutableStri

ios - 我必须使用 __strong 关键字吗?

我看到有人用下面的__strongstaticfoo*_foo=nil;我想知道这里是否需要__strong;我的意思是__strong是默认值?是吗? 最佳答案 因为强引用是default,你是对的。 关于ios-我必须使用__strong关键字吗?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/18618099/

ios - 在 _strong id 类型的对象上找不到属性框架

这是我尝试在IOS中构建的第一个应用程序,但遇到了一些问题。虽然我在这里读过类似的帖子,但我找不到答案。我想在我的按钮点击上显示popoverviewController。但无法做到。我在上面的问题标题中收到错误提示,下面是我的文件.h文件@property(nonatomic,strong)UIPopoverController*popOver;@property(nonatomic,strong)SecondViewController*popOverView;.m文件-(IBAction)Getcompany:(id)sender{SecondViewController*pop

php - 使用 XPATH 删除 <p><strong><br/> </strong></p>

我使用xpath删除 $nodeList=$xpath->query("//p[text()=\"\xC2\xA0\"]");# foreach($nodeListas$node){$node->parentNode->removeChild($node);}但它不会删除这个, 还是这种, 我怎样才能删除它们?或者也许是我应该使用的正则表达式? 最佳答案 试试$nodeList=$xpath->query("//p[normalize-space(.)=\"\xC2\xA0\"]");#&nb

Php adLDAP 错误 - 无法绑定(bind)到服务器 : Strong(er) authentication required

我正在尝试使用PHPadLDAPversion4.04在公司网络上进行身份验证但尚未成功。PHP版本5.2.4我尝试了这个stackoverflow帖子PHPldap-Strong(er)authenticationrequired,运气不好。我不是这个域Controller的管理员;我只需要能够查询即可。我可以pingHOSTNAMEOFDC.domain.location.company.com(我的域Controller的FQDN)域Controller是WindowsServer2012R2Standard。我已经使用DsQuery和PowerShellAD模块成功查询了这个域

c++ - 什么时候应该使用 std::atomic_compare_exchange_strong?

C++11中有两个原子CAS操作:atomic_compare_exchange_weak和atomic_compare_exchange_strong。根据cppreference:Theweakformsofthefunctionsareallowedtofailspuriously,thatis,actasif*obj!=*expectedeveniftheyareequal.Whenacompare-and-exchangeisinaloop,theweakversionwillyieldbetterperformanceonsomeplatforms.Whenaweakcom

c++ - 如何使用 Windows API 获取 "cryptographically strong"随机字节?

我需要获得少量“加密良好”的随机字节。(在我的例子中是8个字节。)是否有任何WindowsAPI?附言。如果这些API向后兼容WindowsXP就好了。但如果没有,它仍然可以工作。谢谢。 最佳答案 我知道我最初询问的是有关WindowsAPI的问题,但自从我发表最初的帖子以来,我有一些时间进行研究。所以我想分享我的发现。事实证明,自从他们的IvyBridge芯片组以来,英特尔包括了一个非常酷的硬件随机数生成器,可通过RDRANDCPUinstruction获得。.因为这是关于Windows实现的问题,而且大多数WindowsPC都运

ios - 为什么仅在第一次返回 __strong 和 __autoreleasing 变量后才会产生不同的对象生命周期?

考虑这段代码:@implementationMyClass-(void)dealloc{NSLog(@"MyClassdealloc:%@",self);}@end@implementationAppDelegate__weakstaticMyClass*weakShared=nil;-(MyClass*)getMyClass{MyClass*tmpHolder=[[MyClassalloc]init];//PREPEND"__autoreleasing"weakShared=tmpHolder;returnweakShared;//ATTENTIONTOTHISLINE}-(void

ios - 为什么在 ARC 的快速枚举循环中需要 __strong

当我做类似下面的事情时,我得到一个错误提示for(UIView*attinbottomAttachments){if(i不能在ARC中修改快速枚举变量:声明__strong__strong有什么作用,为什么我必须添加它? 最佳答案 IfavariableisdeclaredintheconditionofanObjective-Cfastenumerationloop,andthevariablehasnoexplicitownershipqualifier,thenitisqualifiedwithconst__strongand

objective-c - 我什么时候应该对 IBOutlets 使用 weak 或 strong 限定符?

这个问题在这里已经有了答案:关闭11年前。PossibleDuplicate:ShouldIBOutletsbestrongorweakunderARC?在文档中,我读到“socket通常应该很弱,除了从文件所有者到nib文件(或在iOS中,Storyboard场景)中的顶级对象的socket应该很强。”例子?我不明白什么时候最好为IBOutlet使用“弱”而不是“强”属性。