草庐IT

some_instance_variable

全部标签

iphone - 编译到 iOS 设备时出现 "Variable Undeclared"错误,但不适用于模拟器

我有一个自定义的UIVIewController,它是其他Controller的基类,并且有一个自定义UIView变量的实例,该实例由继承的类访问。BaseViewController.h@interfaceBaseViewController:UIViewController{UIView*_vwHeader;}@endBaseViewController.m#import"BaseViewController.h"@implementationBaseViewController-(void)loadView{[superloadView];_vwHeader=[[UIViewal

iphone - 编译到 iOS 设备时出现 "Variable Undeclared"错误,但不适用于模拟器

我有一个自定义的UIVIewController,它是其他Controller的基类,并且有一个自定义UIView变量的实例,该实例由继承的类访问。BaseViewController.h@interfaceBaseViewController:UIViewController{UIView*_vwHeader;}@endBaseViewController.m#import"BaseViewController.h"@implementationBaseViewController-(void)loadView{[superloadView];_vwHeader=[[UIViewal

ios - [CIContext initWithOptions :]: unrecognized selector sent to instance 0x170400960 in xcode8

在ios8.3上运行,在ios9或10上运行没有这个问题。-[CIContextinitWithOptions:]:unrecognizedselectorsenttoinstance0x1704009602016-09-1918:08:21.025***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[CIContextinitWithOptions:]:unrecognizedselectorsenttoinstance0x170400960'***Firstthrowcallsta

ios - [CIContext initWithOptions :]: unrecognized selector sent to instance 0x170400960 in xcode8

在ios8.3上运行,在ios9或10上运行没有这个问题。-[CIContextinitWithOptions:]:unrecognizedselectorsenttoinstance0x1704009602016-09-1918:08:21.025***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'-[CIContextinitWithOptions:]:unrecognizedselectorsenttoinstance0x170400960'***Firstthrowcallsta

ios - 如何解决 "Autosynthesized property ' myVar' will use synthesized instance variable '_myVar' not existing instance variable 'myVar' "的警告?

我这样声明我的.h文件:#import@interfaceNavigationTripViewController:UIViewController{NSArray*questionTitleTrip;NSArray*questionDescTrip;NSMutableArray*answerTrip;NSMutableArray*pickerChoices;intquestionInt;inttotalInt;IBOutletUILabel*questionNum;IBOutletUILabel*questionTotalNum;IBOutletUILabel*recordType;

ios - 如何解决 "Autosynthesized property ' myVar' will use synthesized instance variable '_myVar' not existing instance variable 'myVar' "的警告?

我这样声明我的.h文件:#import@interfaceNavigationTripViewController:UIViewController{NSArray*questionTitleTrip;NSArray*questionDescTrip;NSMutableArray*answerTrip;NSMutableArray*pickerChoices;intquestionInt;inttotalInt;IBOutletUILabel*questionNum;IBOutletUILabel*questionTotalNum;IBOutletUILabel*recordType;

ios - xcode 4.6 中的 "Receiver type for instance messages is a forward declaration"

我想在我的ViewController中调用C++类。所以我创建了一个这样的类:你好.h#import@interfaceHello:NSObject{classNewHello{private:intgreeting_text;public:NewHello(){greeting_text=5;}voidsay_hello(){printf("Greeting_Text=%d",greeting_text);}};NewHello*hello;}-(void)sayHellooooo;@end你好.mm#import"Hello.h"@implementationHello-(voi

ios - xcode 4.6 中的 "Receiver type for instance messages is a forward declaration"

我想在我的ViewController中调用C++类。所以我创建了一个这样的类:你好.h#import@interfaceHello:NSObject{classNewHello{private:intgreeting_text;public:NewHello(){greeting_text=5;}voidsay_hello(){printf("Greeting_Text=%d",greeting_text);}};NewHello*hello;}-(void)sayHellooooo;@end你好.mm#import"Hello.h"@implementationHello-(voi

ios - 绘制矩形 : withAttributes text center vertically or put some padding

我正在使用drawInRect:withAttributes将文本添加到iOS7中的pdf。我需要在CGRect中垂直居中文本,或者至少我需要在CGRect边框和文本之间保持一些间隙/填充。否则文本看起来离​​框太近了。有什么属性可以做到这一点吗?如果不是,最好的方法是什么?下面是我的代码。我试过NSBaselineOffsetAttributeName,但它只会增加每行之间的间隙,但不会增加到矩形边界的间隙。谢谢CGContextRefcurrentContext=UIGraphicsGetCurrentContext();CGContextSetFillColorWithColor

ios - 绘制矩形 : withAttributes text center vertically or put some padding

我正在使用drawInRect:withAttributes将文本添加到iOS7中的pdf。我需要在CGRect中垂直居中文本,或者至少我需要在CGRect边框和文本之间保持一些间隙/填充。否则文本看起来离​​框太近了。有什么属性可以做到这一点吗?如果不是,最好的方法是什么?下面是我的代码。我试过NSBaselineOffsetAttributeName,但它只会增加每行之间的间隙,但不会增加到矩形边界的间隙。谢谢CGContextRefcurrentContext=UIGraphicsGetCurrentContext();CGContextSetFillColorWithColor