G.Morreale
1) Open Xcode 4
In order to make as property drag out outside the interface before the @end!!
[Java EE, ME, Glassfish, Design, Hibernate, Windows Mobile C#, ActionScript]
From Java To Objective C: Strings
My Notes (part 2)
This is a very short introduction from my notes.
A good and complete starting point can be found by google.
The String.
In java we have String Class that represent a string, in objective C there is a NSString object.
Each string constant double quote in objective-c must be prefixed by @
Also in objective C, NSString is immutable like java String.
.objective c version
.java version
From Java To Objective C
My Notes (part 1)
This is a very short introduction from my notes.
A good and complete starting point can be found by google.
I'm a java developer and when I'm going to learn objective-c for the iphone development the matching between the 2 languages became automatic.
Objective C is standard ansi C with object oriented extension.
So many OO arguments found in java can be find in objective C.
In objective C the class usually is split in two file:
Let's go to see some code, this is only my simple notes.
.h file example
#import <UI/Class.h> //like import in java
//interface is a compiler directive, it tell that there is a class definiton
//myClassName the className
//NSObject the parent object
//<aProtocol> it respect the protocol definition (like abstract class in java)
@interface MyClassName: NSObject <aProtocol>
{
int count; //a simple primitive type
id *data; //Weak Type
NSString *aString;
//String type. *stay for pointer. all the instance object variable
//use this pointer notation
}
//property declare a class property
//nonatomic or atomic value regard the thread safety in the accessor method
//retain in the set accessor the variable value is retained
@property (nonatomic, retain) NSString aString
//this is a method interface definition
-(id)aMethod:(NSString)*paramName;
var ws:NameService = new NameService();
ws.addOperation1EventListener(onResultOperation1);
private function onResultOperation1(res:Operation1ResultEvent):void{var value:Operation1ReturnType = res.result._return;
}
//inside costructor possible parameter to be pass to the webservice //operationvar param:Operation1_request = new Operation1_request();ws.Operation1_request_var = param;
ws.Opearation1_send();
<properties>
<source>remoting.EchoService</source>
</properties></destination>
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties></channel-definition>
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><mx:Button x="10" y="10" label="Button"/></mx:Application>
var nc:NetConnection=new NetConnection();nc.connect("http://localhost/amf/test1");var res:Responder=new Responder(onResult,onError);nc.call("func_name",res,"a_parameter");function onResult(e:Object):void{trace(e);}function onError(e:Object):void{trace("Error");}