草庐IT

iphone - ABAddressBookCreate() , ABAddressBookGetGroupCount , ... 返回 @"0x00000000 <nil>"?

我正在尝试获取群组名称,但多次调用此方法“由用户重新加载联系人”后,它给出了nil值和以下错误。-(void)getGroupsName{[groupsNameremoveAllObjects];//addressbookobjecttointeractwithiPhonecontacts.ABAddressBookRefaddressbook=ABAddressBookCreate();//getgroupscountCFIndexgroupsCount=ABAddressBookGetGroupCount(addressbook);//getallavailablegroupsas

ios - PHChange changeDetailsForFetchResult - 总是返回 nil

我正在使用PHPhotoLibrary检索多个这样的照片集:_smartAlbumsFetchResult=[PHAssetCollectionfetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbumsubtype:PHAssetCollectionSubtypeAlbumMyPhotoStreamoptions:nil];[_smartAlbumsFetchResultenumerateObjectsUsingBlock:^(PHAssetCollection*collection,NSUIntegeridx,BOOL

ios - 如果任何值为 NULL,CFPropertyListCreateDeepCopy 返回 nil

我正在使用以下CoreFoundation函数CFPropertyListCreateDeepCopy:用于将不可变对象(immutable对象)转换为可变对象。如果任何对象为NULL,则CFPropertyListCreateDeepCopy返回空。是否有解决此问题的方法。self.packageArray=CFBridgingRelease(CFPropertyListCreateDeepCopy(NULL,(CFPropertyListRef)self.packageArray,kCFPropertyListMutableContainersAndLeaves));CFPrope

ios - 在 iOS 6.1 上,UISwitch IBOutlet 始终为 nil

我在静态UITableView上使用UISwitch时遇到了一些问题。当应用程序加载时,我必须恢复某个UISwitch的最后状态,但每当我检查IBOutlet的状态时,它都是nil。我试过手动分配变量,这也没有帮助。这是我正在做的:设置Controller.h//IBOutletconnectedcorrectly@property(strong,nonatomic)IBOutletUISwitch*switch_displayDetail;SettingsController.m-(void)viewWillAppear:(BOOL)animated{[superviewWillAp

ios - FBSDKProfile currentProfile 为 nil 但 FBSDKAccessToken currentAccessToken 有值

正如标题所说,这是一个错误还是真的有可能?我使用[FBSDKAccessTokencurrentAccessToken].tokenString检查现有的Facebooksession是否存在,然后我将使用[FBSDKProfilecurrentProfile].userID获取session的用户身份。但是有时我会遇到[FBSDKAccessTokencurrentAccessToken].tokenString有一个值但是[FBSDKProfilecurrentProfile]是nil。我将它用于我的应用程序的自动登录功能。感谢您的回复!所以我有这个代码片段:if([FBSDKAc

ios - 为什么 CIImage 的属性方法返回 nil

我正在使用coreImage框架开发一个应用程序。我从UIImage创建了一个CIImage。CIImage*image=[CIImageimageWithCGImage:self.canvasImage.CGImage];这里的self.canvasImage是一个UIImage,我对其进行调试,目标图像由编译器使用一些内存创建。我正在使用以下代码创建一个由属性方法返回的NSDictionary对象。NSDictionary*opts=[imageproperties];这里我的opts对象被分配了nil值。我搜索了它但没有找到解决方案,为什么properties方法返回nil值?

ios - NSPlaceholderDictionary : attempt to insert nil object from objects[1]

我有两个UITextField框,一个用于minPrice,一个用于maxPrice。当我尝试运行由submitButtonIBAction触发的函数时,使用这两个文本字段内容作为参数,它指出对象为空并出现以下错误:'***-[__NSPlaceholderDictionaryinitWithObjects:forKeys:count:]:尝试从对象[1]中插入nil对象'我似乎不明白为什么输入到这些字段中的文本没有正确保存。当我以编程方式初始化它们时,我是否忘记了什么?CriteriaViewController.h:#import#import#import"SearchViewC

ios - CVPixelBuffer 到 CIImage 总是返回 nil

我正在尝试将从AVPlayerItemVideoOutput提取的pixelBuffer转换为CIImage,但始终为零。代码if([videoOutput_hasNewPixelBufferForItemTime:player_.internalPlayer.currentItem.currentTime]){CVPixelBufferRefpixelBuffer=[videoOutput_copyPixelBufferForItemTime:player_.internalPlayer.currentItem.currentTimeitemTimeForDisplay:nil];C

ios - 由于未捕获的异常 'NSInvalidArgumentException' 而终止应用程序,原因 : '+entityForName: nil is not a legal NSManagedObjectContext

我得到的结果为空AppDelegate.h@property(readonly,strong,nonatomic)NSManagedObjectContext*managedObjectContext;@property(readonly,strong,nonatomic)NSManagedObjectModel*managedObjectModel;@property(readonly,strong,nonatomic)NSPersistentStoreCoordinator*persistentStoreCoordinator;AppDelegate.m@synthesizeman

ios - 为什么 UILabel.text 会导致 “fatal error: unexpectedly found nil while unwrapping an Optional value” ?

我已经阅读了这个问题的几个答案,并尝试了所有建议但没有成功。我是swift的新手,正在使用Swift、PHP和MySQL构建应用程序。我在用户登录到应用程序后收到错误消息,系统应该使用UILabel.text通过标签显示用户名。为UILabel.text变量设置值时发生错误。我的代码包含在下面。我尝试在其他页面上对值进行硬编码,但在我的整个项目中都遇到了这个错误。importUIKitclassHomeViewController:UITabBarController{@IBOutletvarusernameLbl:UILabel!overridefuncviewDidLoad(){s