objective c - I keep on getting this expected identifier or '(' -
i keep getting expected identifier or '('
below code. trying example school project. anybody's appreciated. entire script.
// // viewcontroller.m // pocket codez // // created dinesh1201 on 10/9/14. // copyright (c) 2014 dinesh , co. rights reserved. // #import "viewcontroller.h" @interface viewcontroller () - (ibaction)generate:(id)sender; @property (strong, nonatomic) iboutlet uilabel *password; @end @implementation viewcontroller - (ibaction)generate:(id)sender { struct label label = { .password = @"468392" }; } - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } @end
the error located @
struct label label = { .password = @"468392" };
now after edit , saying variable has incomplete type 'struct label'
you seem imply it's struct
initialization that's issue, not have expected error message, correct way initialize 1 or more members of struct
using:
struct label label = { .password = @"468392" };
unless, of course, label
property or instance variable of class (the statement useless, feel information missing necessary answer question completely).
Comments
Post a Comment