草庐IT

set_null

全部标签

ios - CGContext.init() -- 不再允许 NULL 颜色空间

TL;DR:在旧版Obj-C代码中,颜色空间参数值为NULL。这在Swift等价物中是不允许的。使用什么值?我继承了如下代码:unsignedcharpixel[1]={0};CGContextRefcontext=CGBitmapContextCreate(pixel,1,1,8,1,NULL,(CGBitmapInfo)kCGImageAlphaOnly);Swift4CGContext的端口很简单,除了NULL颜色空间值。使用合理的值,我从CGContext.init?()得到了nil。我的翻译是:varpixelValue=UInt8(0)varpixel=Data(buffe

ios - requestAuthorizationWithOptions :completionHandler: and system setting?中的 "options"是什么关系

我正在开发一个应用程序,需要推送通知。我必须在推送之前检查用户是否允许通知,所以我写了一些这样的代码:UNUserNotificationCenter*center=[UNUserNotificationCentercurrentNotificationCenter];UNAuthorizationOptionsoptions=UNAuthorizationOptionSound;//mostsnippetsontheinternetuse'UNAuthorizationOptionBadge|UNAuthorizationOptionAlert|UNAuthorizationOpti

ios - React-native:Axios 不适用于 ios,但适用于 android。错误:NSNull 类型的 JSON 值 '<null>' 无法转换为 NSString

我运行了调试器,但axios发送请求失败。同样的事情在Android中也能完美运行。只要它通过axios发送请求,就会在模拟器上弹出这些红色屏幕:这是给出错误的代码:/*redscreenhereafterrequestsend*/returnaxios.get(config.backend_url+'/api/firebase-user/'+firebaseId).then((userDataFetchResult)=>{dispatch(setUserGeneralData(userDataFetchResult.data.data));dispatch(authOperation

ios - Xcode 10 : The Image set 'customloading' reference a file "mygif.gif" , 但该文件没有有效的扩展名

我将我的xcode9更新为xcode10,然后我的应用程序上的gif突然看不到我的gif。然后当我去我的Assets时。出现。classCustomLoading:UIView{staticletinstance=CustomLoading()varviewColor:UIColor=.brownvarsetAlpha:CGFloat=2.0vargifName:String="customloading"lazyvartransparentView:UIView={lettransparentView=UIView(frame:UIScreen.main.bounds)transpa

ios - 在 Debug模式下,API 请求有效。 Release模式,返回 null

我使用iOS模拟器来测试我的react-native应用程序已经接近完成。在Debug模式下,api请求成功工作并显示在应用程序上。但是,在Release模式下,只有登录请求有效。我目前的详细信息如下:react-native:0.60.3,native-base:2.13.5,react-native-cli:2.0.1,VisualStudioCode1.36.1Xcode11beta7我做了以下事情:将域添加到info.plist中的权限使用不同的API服务器来查看是否是我使用的服务器导致了问题尝试在Xcode中使用调试和Release模式进行不同的优化此登录API请求有效并返回

iphone - NULL MPMediaitemPropertyAssetURL

使用MPMediaQuery然后从歌曲结果中获取MPMediaitemPropertyAssetURL有时会返回null(有时我的意思是在这种情况下,用户歌曲库的1/3)。有谁知道是什么原因造成的?我假设这是由于某种DRM造成的,但它没有在任何地方记录。 最佳答案 这个答案可以回答你的问题:https://stackoverflow.com/a/6401317/536308 关于iphone-NULLMPMediaitemPropertyAssetURL,我们在StackOverflow

iphone - 分层 iPhone 设置文件问题 -- 无法添加到 Settings.bundle

我正在尝试向我的Settings.Bundle添加一个额外的iPhone设置文件类型,并在我的Root.plist中将其作为子Pane类型引用,但它不起作用。我遵循了Apple的文档here,但它不会将plist文件保留为“iPhone设置”类型。我假设这就是我无法将它拖到我的Settings.Bundle文件中的原因。基本上,通过选择"file">“添加新文件...”来添加一个新的plist;选择iOS下的Resources,然后选择plisttype。现在向文件添加一些plist属性。现在右键单击并选择“属性列表类型”,然后选择“iPhone设置”。您会注意到文件中的键发生了变化。

objective-c - 使用对象填充 NSMutableSet 不起作用 - NSLog 和调试器显示 Null

我正在尝试使用NSMutableSet创建一组对象。对象是一个标签,每个标签都有一个id和一个名字。标签类定义如下:#import"Tag.h"@implementationTag@synthesizeid,name;+(id)populateTagObjectWithId:(NSString*)idandName:(NSString*)name{Tag*myTag=[[selfalloc]init];myTag.id=id;myTag.name=name;returnmyTag;}...remainderofcodesnippedout在我的应用程序的其他地方,我使用SQLite来获

ios - NSCoding NSKeyedUnarchiver unarchiveObjectWithFile : returning null

我正在尝试使用NSCoding从我的应用程序中保存一些值。我能够保存该值但无法检索它。这是我声明协议(protocol)的地方:@interfaceAddReminderEventViewController:UIViewController这是我遵守协议(protocol)的地方:-(void)encodeWithCoder:(NSCoder*)enCoder{[enCoderencodeObject:self.eventRepeatDurationDateforKey:kEventRepeatDuration];[enCoderencodeObject:self.eventIDsM

C --- wait(NULL) 作用?

Well,sorry,thatmuchisobvious.Whatyouwanttoknowis,probably,whatitwaitsfor.Theansweris:theterminationofachildprocess.// 答案是:终止一个子进程Whenyoucreateanewchildprocesswith fork(),youhavenocontroloverwhenitwillbeexecutedwithregardtoitsparent-itisuptothescheduler.Youuse wait forsynchronization,whenyouwanttomak