Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS Error with GCRectMake - Sending 'int' to parameter of incompatible type 'CGRect' (aka 'struct CGRect')
    text
    copied!<p>I'm new in the iOS programming. </p> <p>I am following a guide, a book precisely on iOS in Italian. For the first application, I have to modify <code>ViewController.m</code> like this:</p> <pre><code>#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 </code></pre> <p>The problem is here:</p> <pre><code>UILabel *testLabel = [[UILabel alloc] initWithFrame: GCRectMake(30,100,250,40)]; </code></pre> <p>On the <code>GCRectMake</code>: I've one warning and one errors:</p> <pre><code>WARNING Implicit declaration of function 'GCRectMake' is invalid in C99 ERROR Sending 'int' to parameter of incompatible type 'CGRect' (aka 'struct CGRect') </code></pre> <p>I really can not understand what is wrong.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload