Hey
So I'm learning Objective-C with a Java background. It turns out quite good atm. I'm dutch and learning it with a English book. Sometimes I'm not understanding things, but that's why i'm asking it here!
In Java you have a Default Constructor, and you can edit the constructor like in the example.
How is this handeled by Objective-C, anyone has an example for this ?
Further I know you can't really use get in your Getter methods because Cocoa would argue sometimes.
So I'm learning Objective-C with a Java background. It turns out quite good atm. I'm dutch and learning it with a English book. Sometimes I'm not understanding things, but that's why i'm asking it here!
In Java you have a Default Constructor, and you can edit the constructor like in the example.
Code:
public Date (int day, int month, int year){
setYear(day);
setMonth(month);
setDay(year);
}
How is this handeled by Objective-C, anyone has an example for this ?
Further I know you can't really use get in your Getter methods because Cocoa would argue sometimes.
Code:
public class Date {
private int year;
private int month;
private int day;
public Date (){
}
public Date (int day, int month, int year){
setYear(day);
setMonth(month);
setDay(year);
}
public void setYear(int year){
}
public void setMonth(int month){
}
public void setDay(int day){
}
public int getYear(){
}
public int getMonth(){
}
public int getDay(){
}
}