我正在关注一本指南,这本书正是在意大利语的iOS上.
对于第一个应用程序,我必须像这样修改VIEwController.m:
#import "VIEwController.h"@implementation VIEwController- (voID)dIDReceiveMemoryWarning{ [super dIDReceiveMemoryWarning]; // Release Any chached data,images,etc that aren't in use.} - (voID)vIEwDIDLoad{ [super vIEwDIDLoad]; // Do any additional setup after loading the vIEw,typically from a nib.}- (voID)datIDettaglioChiudi:(datIDettaglio *)controller{ //altre operazioni possibii dopo la dismissModal NSLog(@"... di ritorno dal dismissModal..."); [controller dismissVIEwControllerAnimated:YES completion:nil];}- (voID)prepareForSegue:(UIStoryboardSegue *)segue sender:(ID)sender{ if([segue.IDentifIEr isEqualToString:@"dettaglio"]){ datIDettaglio *mioController1 = segue.destinationVIEwController; [mioController1 setDelegate:self]; //aggiunta di una UILabel - qui è possibile personalizzare la propria vista direttamente da codice UILabel *testLabel = [[UILabel alloc] initWithFrame: GCRectMake(30,100,250,40)]; [testLabel setText:@"Etichetta di test"]; [testLabel setBackgroundcolor:[UIcolor greencolor]]; [testLabel setTextcolor:[UIcolor blackcolor]]; [mioController1.vIEw addSubvIEw:testLabel]; }}- (voID)vIEwWillAppear:(BOol)animated{ [super vIEwWillAppear:animated];}@end
问题出在这里:
UILabel *testLabel = [[UILabel alloc] initWithFrame: GCRectMake(30,40)];
在GCRectMake上:我有一个警告和一个错误:
WARNING Implicit declaration of function 'GCRectMake' is invalID in C99ERROR Sending 'int' to parameter of incompatible type 'CGRect' (aka 'struct CGRect')
我真的无法理解有什么不对.
解决方法 它是CGRectMake,而不是GCRectMake. CG代表Core Graphics. 总结以上是内存溢出为你收集整理的objective-c – GCRectMake的iOS错误 – 将’int’发送到不兼容类型’CGRect'(又名’struct CGRect’)的参数全部内容,希望文章能够帮你解决objective-c – GCRectMake的iOS错误 – 将’int’发送到不兼容类型’CGRect'(又名’struct CGRect’)的参数所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)