Structs don't have initializers, if you want to create a struct with a particular set of values you could write a function that returns creates and initialises it for you:
For example
struct Data {
BOOL isInit;
BOOL isRegister;
NSString* myValue;
};
Data MakeInitialData () {
data Data;
data.isInit = NO;
data.isRegister = NO;
data.myValue = @"mYv4lue";
return data;
}
now you can get a correctly set up struct with:
Data newData = MakeInitialData();
A note, though; you seem to be using ARC, which doesn't work well with structs that have object pointers in them. The recommendation in this case is to just use a class instead of a struct.
Structs don't have initializers, if you want to create a struct with a particular set of values you could write a function that returns creates and initialises it for you:
For example
now you can get a correctly set up struct with:
A note, though; you seem to be using ARC, which doesn't work well with structs that have object pointers in them. The recommendation in this case is to just use a class instead of a struct.