Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old Dec 7, 2012, 10:51 AM   #1
Mvkoe
macrumors member
 
Join Date: Aug 2008
Location: Belgium
Objective-C / Java Question

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.

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(){
	
	}
}
Mvkoe is offline   0 Reply With Quote

 
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Noob Objective-C / Framework / AVFoundation question Golgafrincham Mac Programming 0 Jan 30, 2014 02:54 AM
Chrome on OS X -- Java plugin / Java 7 vs Java 6 Issue booyahbooyah Mac Applications and Mac App Store 4 May 31, 2013 09:13 AM
java to Objective-C spilakalb Alternatives to iOS and iOS Devices 0 Sep 30, 2012 11:17 PM
Objective C question farmerdoug Mac Programming 4 Sep 16, 2012 02:44 PM
Java question brentg33 Mac Applications and Mac App Store 1 Aug 28, 2012 06:45 PM

Forum Jump

All times are GMT -5. The time now is 10:08 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC